-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrocker.ahk
176 lines (148 loc) · 3.65 KB
/
rocker.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
; rocker.ahk
; Description: Mouse function calls
; Requires: ide.ahk
; Author: Travis Gall
; Setup {{{1
Counter = 1
RButtonFirst := True
LButtonFirst := True
; Functions {{{1
RRocker()
{
If RButtonFirst
{
LButtonFirst := False
CtrlLock := False
LButtonLock := False
CtrlCounts := 0
LButtonCounts := 0
if GetKeyState("RButton")
{
Loop
{
If !GetKeyState("RButton")
Break
If GetKeyState("Ctrl") And !CtrlLock
{
CtrlCounts := CtrlCounts + 1
CtrlLock := True
}
If !GetKeyState("Ctrl")
CtrlLock := False
If GetKeyState("LButton") And !LButtonLock
{
LButtonCounts := LButtonCounts + 1
LButtonLock := True
KeyWait, LButton
}
If !GetKeyState("LButton")
LButtonLock := False
}
}
; Normal LButton operation
If (CtrlCounts != 0 Or LButtonCounts != 0)
{
Sleep, 25
IfWinExist, ahk_class #32768 ; Close context menu if open
Send, {Escape}
}
; Navigate backwards
IfEqual LButtonCounts, 1
{
; Chrome
IfWinActive, % "ahk_exe" . "chrome.exe"
Send, !{Left}
; Notepad++
IfWinActive, % "ahk_exe" . "Notepad++.exe"
Send, ^{PgUp}
IfWinActive, % "ahk_exe" . "LabVIEW.exe"
{
BlockDiagramList := CurrentBlockDiagrams()
Gui, LVBD: New, , LV - Blocks
Gui, Add, DropDownList, w600 vBlockDiagram, %BlockDiagramList%
Gui, Show, , LV - Blocks
Loop, %Counter%
{
Send, {Down}
Counter := Counter + 1
}
; GoSub, SelectBlockDiagram
}
}
IfEqual, LButtonCounts, 2
MsgBox, "Test2"
LButtonFirst := True
}
}
LRocker()
{
If LButtonFirst
{
RButtonFirst := False
CtrlLock := False
RButtonLock := False
CtrlCounts := 0
RButtonCounts := 0
if GetKeyState("LButton")
{
Loop
{
If !GetKeyState("LButton")
Break
If GetKeyState("Ctrl") And !CtrlLock
{
CtrlCounts := CtrlCounts + 1
CtrlLock := True
}
If !GetKeyState("Ctrl")
CtrlLock := False
If GetKeyState("RButton") And !RButtonLock
{
RButtonCounts := RButtonCounts + 1
RButtonLock := True
KeyWait, RButton
}
If !GetKeyState("RButton")
RButtonLock := False
}
}
; Normal LButton operation
If (CtrlCounts != 0 Or RButtonCounts != 0)
{
Sleep, 25
IfWinExist, ahk_class #32768 ; Close context menu if open
Send, {Escape}
}
; Navigate backwards
IfEqual RButtonCounts, 1
{
; Chrome
IfWinActive, % "ahk_exe" . "chrome.exe"
{
; Navigate "Tabs"
IfEqual CtrlCounts, 1
Send, {Ctrl}{Tab}
; Navigate "Forward"
Else
Send, !{Right}
}
; Notepad++
IfWinActive, % "ahk_exe" . "Notepad++.exe"
Send, ^{PgDn}
; LabVIEW found in ide.ahkButton Up}{Escape}{LButton}
IfWinActive, % "ahk_exe" . "LabVIEW.exe"
{
BlockDiagramList := CurrentBlockDiagrams()
Gui, LVBD: New, , LV - Blocks
Gui, Add, DropDownList, w600 vBlockDiagram, %BlockDiagramList%
Gui, Show, , LV - Blocks
Send, {End}
Counter := 1
; GoSub, SelectBlockDiagram
}
}
IfEqual, RButtonCounts, 2
MsgBox, "Test"
RButtonFirst := True
}
}