-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDaily.ahk
348 lines (308 loc) · 6.54 KB
/
Daily.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
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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
#MaxHotkeysPerInterval 200
SetTitleMatchMode, 2
SetCapsLockState, AlwaysOff
df := "C:\Program Files (x86)\DisplayFusion\DisplayFusionCommand.exe"
nc := "A:\Software\nirsoft_package\NirSoft\nircmd.exe"
CapsLock & Enter::
If GetKeyState("CapsLock", "T") {
SetCapsLockState, AlwaysOff
} Else {
SetCapsLockState, AlwaysOn
}
Return
CapsLock & q::Media_Prev
CapsLock & w::
pro := "A:\Software\foobar2000\foobar2000.exe"
If WinExist("ahk_exe " . pro) {
If WinActive() {
WinMinimize
} else {
WinActivate
}
} else {
Run, %pro%
}
Return
CapsLock & e::Media_Play_Pause
CapsLock & r::Media_Next
; Active window show time
CapsLock & t::
FormatTime, time
ToolTip, %time%, 0, 0
KeyWait, CapsLock
ToolTip
Return
CapsLock & y::SendInput, !{Escape}
CapsLock & u::
SendInput, {Blind}{LAlt Down}{Tab}
Return
CapsLock & u Up::
KeyWait, CapsLock
SendInput, {LAlt Up}
Return
CapsLock & i::
pro := "cmd.exe"
If WinExist("ahk_exe " . pro) {
If WinActive() {
WinClose
} else {
WinActivate
}
} else {
Run, %pro%
}
Return
CapsLock & o::
pro := "A:\Software\SpeedCrunch\speedcrunch.exe"
If WinExist("ahk_exe " . pro) {
If WinActive() {
WinClose
} else {
WinActivate
}
} else {
Run, %pro%
}
Return
CapsLock & p::SendInput, {Blind}{PrintScreen}
; Adjust volume
CapsLock & a::Return
CapsLock & WheelUp::
If !GetKeyState("a", "P") {
SendInput, {Volume_Up}
} Else {
MouseGetPos,,,pos
WinGet, PID, PID, ahk_id %pos%
Run, %nc% changeappvolume /%PID% 0.02
}
Return
CapsLock & WheelDown::
If !GetKeyState("a", "P") {
SendInput, {Volume_Down}
} Else {
MouseGetPos,,,pos
WinGet, PID, PID, ahk_id %pos%
Run, %nc% changeappvolume /%PID% -0.02
}
Return
CapsLock & MButton::
If !GetKeyState("a", "P") {
SendInput, {Volume_Mute}
} Else {
MouseGetPos,,,pos
WinGet, PID, PID, ahk_id %pos%
Run, %nc% muteappvolume /%PID% 2
}
Return
CapsLock & s::
pro := "sndvol.exe"
Run, %pro%,, Max
KeyWait, s
WinClose, ahk_exe sndvol.exe
Return
CapsLock & d::
pro := "sndvol.exe"
;pos := % A_ScreenHeight * 65536
Run, %pro% -m %pos%
WinWait, ahk_exe sndvol.exe
WinMove, ahk_exe sndvol.exe,,,, %A_ScreenWidth%
KeyWait, d
WinClose, ahk_exe sndvol.exe
Return
CapsLock & f::
pro := "explorer.exe"
If WinExist("ahk_exe " . pro . " ahk_class CabinetWClass") {
If WinActive() {
SendInput, ^{tab}
} else {
WinActivate
}
} else {
Run, %pro%
}
Return
CapsLock & g::
WinActivate, ahk_class #32770
If WinActive("ahk_class #32770") {
ControlGetText, loc, ToolbarWindow323, ahk_exe explorer.exe ahk_class CabinetWClass
loc := StrReplace(loc, "Address: ")
ControlFocus, Edit1
SendInput,!d^a{Text}%loc%
SendInput, {Enter}
}
KeyWait, g
Return
; Vim commands
CapsLock & h::Left
CapsLock & j::Down
CapsLock & k::Up
CapsLock & l::Right
CapsLock & `;::
pro := "gvim.exe"
If WinExist("ahk_exe " . pro) {
If WinActive() {
WinActivateBottom, ahk_exe %pro%
} else {
WinActivate
}
} else {
Run, %pro%
}
Return
; Active window kill task
CapsLock & z::
WinGet, pro, ProcessName, A
if (pro != "explorer.exe") {
WinGet, PID, PID, A
Run, Taskkill /PID %PID% /F /T,, Hide
}
Return
CapsLock & x::
WinGet, ID, ID, A
WinMinimize, ahk_id %ID%
KeyWait, x
WinRestore, ahk_id %ID%
WinActivate, ahk_id %ID%
Return
CapsLock & c::
If WinExist(" - YouTube - Google Chrome") {
ControlFocus
ControlSend,, k
} Else If WinExist("ahk_exe mpv.exe") {
ControlFocus
ControlSend,, {Space}
} else {
;ControlFocus,, - Google Chrome
;ControlSend,, {Space}, - Google Chrome
SendInput, {Media_Play_Pause}
}
Return
CapsLock & v::
Winget, con, ControlList, A
MsgBox, %con%
Return
CapsLock & b::
WinGet, exe, ProcessPath, A
Run, explorer.exe /select`,"%exe%"
Return
CapsLock & n::Return
CapsLock & m::
WinGet, exe, ProcessPath, A
WinGetClass, cla, A
WinActivateBottom, ahk_exe %exe% ahk_class %cla%
Return
CapsLock & ,::
pro := "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"
If WinExist("ahk_exe " . pro) {
If WinActive() {
SendInput, ^{tab}
} else {
WinActivate
}
} else {
Run, %pro%
}
Return
CapsLock & .::Return
CapsLock & /::^+!#F1
CapsLock & NumpadSub::
WinGet, id, List,,, Program Manager
Loop, %id% {
this_id := id%A_Index%
WinActivate, ahk_id %this_id%
WinGetClass, this_class, ahk_id %this_id%
WinGetTitle, this_title, ahk_id %this_id%
MsgBox, 4, , Visiting All Windows`n%A_Index% of %id%`nahk_id %this_id%`nahk_class %this_class%`n%this_title%`n`nContinue?
IfMsgBox, NO, break
}
Return
; Media keys
CapsLock & Up::Launch_Media
CapsLock & Down::Media_Play_Pause
CapsLock & Left::Media_Prev
CapsLock & Right::Media_Next
; Turn off Screen
CapsLock & Space::
KeyWait, Space
KeyWait, CapsLock
SendMessage, 0x112, 0xF170, 2,, Program Manager
Return
; Function Keys
CapsLock & F1::F13
CapsLock & F2::F14
CapsLock & F3::F15
CapsLock & F4::F16
CapsLock & F5::F17
CapsLock & F6::F18
CapsLock & F7::F19
CapsLock & F8::F20
CapsLock & F9::F21
CapsLock & F10::F22
CapsLock & F11::F23
CapsLock & F12::F24
CapsLock & Esc::Suspend
#If WinActive("ahk_class Vim")
CapsLock::Escape
#If
#If WinActive("Minecraft ahk_exe javaw.exe")
Numpad1::
SendInput, {x Down}{1 Down}
KeyWait, Numpad1
SendInput, {1 Up}{x Up}
Return
Numpad2::
SendInput, {x Down}{2 Down}
KeyWait, Numpad2
SendInput, {2 Up}{x Up}
Return
Numpad3::
SendInput, {x Down}{3 Down}
KeyWait, Numpad3
SendInput, {3 Up}{x Up}
Return
Numpad4::
SendInput, {x Down}{4 Down}
KeyWait, Numpad4
SendInput, {4 Up}{x Up}
Return
Numpad5::
SendInput, {x Down}{5 Down}
KeyWait, Numpad5
SendInput, {5 Up}{x Up}
Return
Numpad6::
SendInput, {x Down}{6 Down}
KeyWait, Numpad6
SendInput, {6 Up}{x Up}
Return
Numpad7::
SendInput, {x Down}{7 Down}
KeyWait, Numpad7
SendInput, {7 Up}{x Up}
Return
Numpad8::
SendInput, {x Down}{8 Down}
KeyWait, Numpad8
SendInput, {8 Up}{x Up}
Return
Numpad9::
SendInput, {x Down}{9 Down}
KeyWait, Numpad9
SendInput, {9 Up}{x Up}
Return
Numpad0::
SendInput, {F3 Down}{n Down}
KeyWait, Numpad0
SendInput, {F3 Up}{n Up}
Return
NumpadAdd::
SendInput, {F3 Down}{b Down}
KeyWait, NumpadAdd
SendInput, {F3 Up}{b Up}
Return
NumpadEnter::
SendInput, {F3 Down}{g Down}
KeyWait, NumpadEnter
SendInput, {F3 Up}{g Up}
Return
#If