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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
|
;; Program shortcuts ----------------------------------------------------------
;; -> body
#IfWinActive ahk_class ConsoleWindowClass
!F4::WinClose, A
#IfWinActive ahk_exe WINWORD.EXE
XButton1::SendInput, +{F5} ; cycle cursor position backwards
#IfWinActive ahk_exe EXCEL.EXE
!s::SendInput, ^s{Space}
#IfWinActive ahk_class Audition v1.5
+WheelUp::
Loop, 30
SendInput, ^+{Left}
return
+WheelDown::
Loop, 30
SendInput, ^+{Right}
return
#IfWinActive ahk_class EVERYTHING
WheelUp::Up
WheelDown::Down
#IfWinActive ahk_class SciTEWindow
F2::Gosub, TrayRebuild ; rebuild scripts.ahk
#IfWinActive ahk_exe firefox.exe ahk_class MozillaWindowClass
^'::^g
F1::SendInput, {WheelUp}
F2::SendInput, {WheelDown}
!F1::
Loop, 5
SendInput, {WheelUp}
return
!F2::
Loop, 5
SendInput, {WheelDown}
return
F3::SendInput, !{Left}
F4::SendInput, !{Right}
; No stylesheet
F8::
SendInput, {Alt}
Sleep, 10
SendInput, {Right}{Right}{Down}{Down}{Down}{Down}{Right}{Enter}
return
; First stylesheet
F9::
SendInput, {Alt}
Sleep, 10
SendInput, {Right}{Right}{Down}{Down}{Down}{Down}{Right}{Down}{Enter}
return
; Default window size
F10::WinMove, A,,,, 1211, 1118
#IfWinActive ahk_class KMeleon Browser Window
F3::SendInput, !{Left}
F4::SendInput, !{Right}
!F1::SendInput, {LAlt Up}{Up}
!F2::SendInput, {LAlt Up}{Down}
F1::
Loop, 5
SendInput, {WheelUp}
return
F2::
Loop, 5
SendInput, {WheelDown}
return
#IfWinActive ahk_class MediaPlayerClassicW
F10::WinMove, A,,,, 240, 180
Esc::
WinGetPos, x, y, w, h
if (x = 0 and y = 0 and w = A_ScreenWidth and h = A_ScreenHeight)
SendInput, !{Enter}
return
~RShift:: ; show controls (including time remaining)
WinGetPos, x, y, w, h, A
if not (x = 0 and y = 0 and w = A_ScreenWidth and h = A_ScreenHeight)
return
MouseGetPos, mx, my
MouseMove, % A_ScreenWidth, % A_ScreenHeight, 0
KeyWait, RShift
MouseMove, % mx, % my, 0
return
~LShift:: ; show playlist
WinGetPos, x, y, w, h, A
MouseGetPos, mx, my
SendInput, {LCtrl Down}7{LCtrl Up}
if (x = 0 and y = 0 and w = A_ScreenWidth and h = A_ScreenHeight)
MouseMove, % A_ScreenWidth, 0, 0
KeyWait, LShift
MouseMove, % mx, % my, 0
SendInput, {LCtrl Down}7{LCtrl Up}
return
Numpad0:: ; crop to 4:3
SendInput, {Numpad9}{Numpad9}{Numpad9}{Numpad9}{Numpad9}{Numpad9}{Numpad9}{Numpad9}{Numpad9}{Numpad9}{Numpad9}{Numpad9}{Numpad9}
return
#IfWinActive ahk_class Photoshop
MButton::
SendInput, {Space Down}{LButton Down}
KeyWait, MButton
SendInput, {Space Up}{LButton Up}
return
#IfWinActive
#If WinActive("ahk_class 9pmgraphics") and Layout() = layouts.sv ; see tt.layout.ahk
^!8::SendInput, {ASC 91}
^!9::SendInput, {ASC 93}
^!+::SendInput, {ASC 92}
<^>!8::SendInput, {ASC 91}
<^>!9::SendInput, {ASC 93}
<^>!+::SendInput, {ASC 92}
#If WinActive("ahk_class 9pmgraphics") and !AltTabActive
!Tab::
SendInput, {LAlt}
SendInput, {LAlt Down}{Tab}
AltTabActive := 1
KeyWait, LAlt
SendInput, {LAlt Up}
AltTabActive := 0
return
#If WinActive("ahk_exe SimCity 4.exe")
; Fix pausing for non-English keyboard layouts
^SC029::
old := Layout()
us := DllCall("LoadKeyboardLayout", "Str", "00000409", "Int", 1)
DllCall("SendMessage", "UInt", WinActive("A"), "UInt", 80, "UInt", 1, "UInt", us)
SendInput, {LCtrl Down}``{LCtrl Up}
DllCall("SendMessage", "UInt", WinActive("A"), "UInt", 80, "UInt", 1, "UInt", old)
return
#IfWinActive ahk_class OperaWindowClass
!d::SendInput, {LCtrl Down}l{LCtrl Up}
/*
#IfWinActive ahk_class Notepad2
F5::
return
*/
#If WinActive("ahk_exe v2game.exe")
MButton::RButton
RButton::MButton
;; -> library
ClipCursor(Confines := True, Left := 100, Top := 200, Right := 800, Bottom := 900)
{
if !(Confines)
return DllCall("user32.dll\ClipCursor")
static RECT, init := VarSetCapacity(RECT, 16, 0)
NumPut(Left, RECT, 0, "Int"), NumPut(Top, RECT, 4, "Int"), NumPut(Right, RECT, 8, "Int"), NumPut(Bottom, RECT, 12, "Int")
if !(DllCall("user32.dll\ClipCursor", "Ptr", &RECT))
return DllCall("kernel32.dll\GetLastError")
return 1
}
VictoriaWindowMessage(wParam, lParam)
{
if (wParam = 4 or wParam = 32772) ; HSHELL_WINDOW_ACTIVATED | HSHELL_RUDEAPPACTIVATED
{
WinGet, exe, ProcessName, A
if (exe = "v2game.exe")
{
Sleep, 1500
ClipCursor(True, 6, 6, A_ScreenWidth-5, A_ScreenHeight-5)
}
}
}
;; -> init
WindowMessageHandlers.Push("VictoriaWindowMessage")
;; -> body
#IfWinActive
|