forked from TaranVH/2nd-keyboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
WINDOWS KEY ASSIGNMENTS.ahk
252 lines (182 loc) · 7.18 KB
/
WINDOWS KEY ASSIGNMENTS.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
#NoEnv
SendMode Input
#SingleInstance force
; GroupAdd, ThisScript, %A_ScriptName% ; Add any window containing this script's name to the group ThisScript
; ;;;https://www.reddit.com/r/AutoHotkey/comments/39gjam/what_are_your_favorite_ahk_tricks/
; ; ---------------------------------
; ; Auto-reload on save
; ; ---------------------------------
; ; Reloads script if active window is the script editor
; ; Reloads on Ctrl-S in the editor window
; WinGetTitle, Title, A
; MsgBox, The active window is "%Title%".
; MsgBox, The group is %ThisScript%
; MsgBox, The name is %A_ScriptName%
; #IfWinActive ahk_group ThisScript ; Only run if met. ; Otherwise, ignore hotkey
; #IfWinActive A_ScriptName ; Only run if met. ; Otherwise, ignore hotkey
; ~^s::
; msgbox,,, reloading meoww. ,0.3
; TrayTip, Reloading updated script, %A_ScriptName%
; ;SetTimer, RemoveTrayTip, 2000
; ;Sleep, 2000
; sleep 100
; Reload
; return
; Menu, Tray, Icon, shell32.dll, 16
;when you get to #include, it means the END of the autoexecute section. So that stuff must go before this line.
#include C:\Users\TaranWORK\Documents\GitHub\2nd-keyboard\Almost All Windows Functions.ahk
#MaxHotkeysPerInterval 2000
Menu, Tray, Icon, shell32.dll, 16
SetNumLockState, on ;you won't be able to cahnge the state of numlock when this is used.
SetScrollLockState, off
#IfWinActive
#IfWinActive ahk_class Notepad++
;instant save and reload for this script -- and i guess not the other ones...?
F5::
send ^s
sleep 100
Reload
Return
#IfWinActive
#IfWinActive ahk_class MozillaWindowClass ;or ahk_class Chrome_WidgetWin_1
F1::send ^+{tab} ;control shift tab, which goes to the next tab
F2::send ^{tab} ;control tab, which goes to the previous tab
F3::send ^w ;control w, which closes a tab
F4::send {mButton} ; middle mouse button, which opens a link in a new tab.
#IfWinActive
#IfWinActive ahk_class Chrome_WidgetWin_1
F1::send ^+{tab} ;control shift tab, which goes to the next tab
F2::send ^{tab} ;control tab, which goes to the previous tab
F3::send ^w ;control w, which closes a tab
F4::send {mButton} ; middle mouse button, which opens a link in a new tab.
#IfWinActive ahk_exe notepad++.exe
F1::send ^+{tab} ;control shift tab, which goes to the next tab
F2::send ^{tab} ;control tab, which goes to the previous tab
F3::send ^w
#IfWinActive ahk_exe Photoshop.exe
F1::send ^+{tab} ;control shift tab, which goes to the next tab
F2::send ^{tab} ;control tab, which goes to the previous tab
F3::send ^w
#IfWinActive
; ;RIP Monty Oum https://youtu.be/qSuTnCFqMkw?t=1m21s
; #IfWinActive ahk_exe Photoshop.exe
; F1::sendinput {alt down}iac{alt up}
#IfWinActive, ahk_group ExplorerGroup
; ctrl L, alt D, or F4 will highlight the address bar. But in different ways..?
^+!d::
sleep 10
Sendinput !d
sleep 10
return
#IfWinActive, ahk_class CabinetWClass
`::
Send !{up} ;This allows you to use the TILDE to go DOWN one folder level in explorer save boxes
Return
+`::Send !{left} ;shift tilde will go "back" in explorer save boxes
#IfWinActive
scrollLock::Sendinput ^+{printscreen} ;assigning 'capture region' straight to scrollLock in ShareX does not work, so i have to remap it here.
; ;use scroll lock's status
; ;to toggle a macro keyboard
; #If GetKeyState("ScrollLock","T")
; a::msgbox, macro 1
; b::msgbox, macro 2
; c::msgbox, macro 3
; d::msgbox, macro 4
; e::msgbox, macro 5
; f::Sendinput, {alt down}iac{alt up}
; g::Send,{LCtrl down}{NumpadAdd}{LCtrl up}
; h::Send, #b{left}{left}{enter}
; #If
;;shortcut to CLOSE FIREFOX with no bullshit or fanfare or annoying dialouge boxes that try to argue with you. Just completely nuke it from orbit so we can start over
^!+f::Run, %comspec% /c "taskkill.exe /F /IM firefox.exe",, hide
;shortcut to forcefully CLOSE PREMIERE, WITH NO BULLSHIT. BULLDOZE IT FLAT, BURN IT, SALT THE EATH, NUKE IT FROM ORBIT. JUST FUCKING DIE!!!
^!+p::
Run, %comspec% /c "taskkill.exe /IM /Adobe Premiere Pro.exe /T /F" ;,, hide
sleep 100
;Run, %comspec% /c "taskkill.exe /F /PID 72536",, hide
tooltip, killed premiere
sleep 100
tooltip,
return
F13::back()
^F1::switchToFirefox()
+^F1::switchToOtherFirefoxWindow()
^F2::switchToExplorer()
!^F2::closeAllExplorers()
^F3::switchToPremiere()
^F4::switchToWord()
+^F4::switchWordWindow()
^F5::switchToChrome()
+^F6::
windowSaver()
msgbox,,, savedCLASS = %savedCLASS% `nsavedEXE = %savedEXE%, 0.6
Return
^F6::
;I had to learn just now to use the parameter to pass "savedCLASS" even though it's already a global variable. Just works better this way... but really IDK what i am doing.
; msgbox,,, switching to `nsavedCLASS = %savedCLASS% `nEXE = %savedEXE%, 0.5
switchToSavedApp(savedCLASS) ;Macro key G14
return
;The optional script below allows you to use the TILDE to go DOWN one folder level in explorer
#IfWinActive ahk_exe explorer.exe
`::
Send !{up}
Return
;this converts F4 into ALT F4, but only for explorer. this is just to save one more keypress, since i close explorer windows in this way quite a lot.
;There is a deliberate delay added, since in SOME situations, ALT would be recognised, but not F4. Adding a delay takes care of that.
#IfWinActive ahk_exe explorer.exe
F4::
Send {alt down}
sleep 10
Send {F4}
sleep 10
Send {alt up}
Return
;script to resize name field so the entire field is readable
F7::Send,{LCtrl down}{NumpadAdd}{LCtrl up}
;;; these things below will turn an explorer window into one with this address, unless it is already open - in which case, we switch over to it.
;;; each one is triggered by a pre-programmed techkeys keyboard, so that each is actually just one keystroke to engage.
#IfWinActive
; ^!+1::runexplorer("Z:\Linus\1. Linus Tech Tips\Pending")
^!numpadEnd::
StringToSend = runexplorer() 2nd-keyboard
Send_WM_COPYDATA(StringToSend)
runexplorer("C:\Users\TaranWORK\Documents\GitHub\2nd-keyboard")
Send,{LCtrl down}{NumpadAdd}{LCtrl up} ;expand name field
return
^!numpaddown::
;msgbox, wtf
StringToSend = runexplorer() Project template
Send_WM_COPYDATA(StringToSend)
runexplorer("Z:\Linus\1. Linus Tech Tips\1. Template File Structure\Project")
return
;!+3::runexplorer("C:\Users\TaranWORK\Videos\Desktop") ;this is labeled "shadowplay."
;^!+numpad3::
^!numpadpgdn::
StringToSend = runexplorer() shadowplay recordings
Send_WM_COPYDATA(StringToSend)
runexplorer("C:\Users\TaranWORK\Videos\Desktop")
sleep 5
;send {alt}vo{down}{enter} ;sort by date modified, but it functions as a toggle...
return
;C:\Users\TaranWORK\Videos\Base Profile ;for some reason, the recordings sometimes go into this folder now.
;;; done ;;;;
#IfWinActive
;opens the CLOCK / CALENDAR. ;http://superuser.com/questions/290068/windows-keyboard-shortcut-to-view-calendar
#z::
Send #b{left}{left}{enter}
Return
#IfWinActive
;control alt shift T -- click on the address bar for any youtube video, and this will link you to the thumbnail!
^!+T::
Send {end}{left 11}{backspace 40}https://i.ytimg.com/vi/{right 11}/sddefault.jpg{enter}
; Send {end}{left 11}{backspace 40}https://i.ytimg.com/vi/{right 11}/maxresdefault.jpg{enter}
return
;EXAMPLE: https://i.ytimg.com/vi/L-zDtBINvzk/hqdefault.jpg
;http://img.youtube.com/vi/<insert-youtube-video-id-here>/maxresdefault.jpg
Joy1::msgbox you hit Joy1
Joy2::msgbox you hit Joy2
Joy3::msgbox you hit Joy3
Media_Next::
msgbox hiiiee. testing stuff.
return
#ifwinactive