forked from camerb/AHKs
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGlobalHotkeys.ahk
204 lines (166 loc) · 5.88 KB
/
GlobalHotkeys.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
/* KEYS !
Work Keyboard Home Keyboard
============= =============
vkA6sc16A Browser_Back ;(not on home kybd)
vkA7sc169 Browser_Forward ;(not on home kybd)
vkAEsc12E ;vol down;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;vkADsc120 ;messenger;;;;
vkADsc120 ;mute;;;;;;;;;;;;;;;; COLLISIONS ;;;;;;;;;;;;vkAEsc12E ;webcam;;;;;;;
vkAFsc130 ;vol up;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;vkAFsc130 ;mute;;;;;;;;;
vkADsc120 ;mute?????
vkB3sc122 ;play/pause vkB5sc16D Launch_Media
vkACsc132 ;web/home vkACsc132 ;my home
vkAAsc165 Browser_Search vkAAsc165 Browser_Search
vkB4sc16C Launch_Mail vkB4sc16C Launch_Mail
*/
;somehow this is the same key at work and home... not understanding why (maybe after reformat)
SC120::
SpiffyMute()
return
;Kill the AppsKey menu & act like a modifier
AppsKey:: return
;;;;;;;;;;;;;;AppsKey:: Send, {AppsKey}
;if (in use appskey to launch temp hotkey mode)
;Run, temporary.ahk
;return
;Alt-Tab Replacements (no need to let go of AppsKey)
AppsKey & RShift:: AltTab
AppsKey & Enter:: ShiftAltTab
;Mappings for the temporary hotkeys
AppsKey & 1:: Run, temporary1.ahk
AppsKey & 2:: Run, temporary2.ahk
AppsKey & 3:: Run, temporary3.ahk
AppsKey & 4:: Run, temporary4.ahk
AppsKey & 5:: Run, temporary5.ahk
AppsKey & 6:: Run, temporary6.ahk
AppsKey & 7:: Run, temporary7.ahk
AppsKey & 8:: Run, temporary8.ahk
AppsKey & 9:: Run, temporary9.ahk
AppsKey & 0:: Run, ResaveTemporary.ahk
;Egg Timer
AppsKey & t:: Run, EggTimer.ahk
;Arrange Windows
AppsKey & w:: Run, ArrangeWindows.ahk
;Nopaste macro
Appskey & v:: Run, nopaste.ahk
;Debug (on work pc)
AppsKey & d:: Run, DebugAgain.ahk
;View All Tasks
AppsKey & a:: Run, TaskMgr-AllTasks.ahk
;Make New Task
AppsKey & n:: Run, TaskMgr-NewTask.ahk
;Make New Jira Issue
AppsKey & j:: Run, CreateJiraIssue.ahk
;PrintScreen, Crop and Save
AppsKey & c:: Run, CaptureAhkImage.ahk
;Show our AHK post-it notes (question mark key)
AppsKey & /:: Run, PostItNotes.ahk
;Suspend hotkeys for 10 seconds
;so user can use a key combo that is normally overridden
AppsKey & s::
Suspend
Sleep, 10000
Suspend
return
;TODO start FARR if it exists but isn't running
;Run an AHK from the AHKs folder
AppsKey & k::
if NOT ProcessExist("FindAndRunRobot.exe") and NOT IsVM()
RunProgram("FindAndRunRobot.exe")
if ProcessExist("FindAndRunRobot.exe")
{
;use Find and Run Robot, if possible
Send, {PAUSE}
return
}
InputBox, filename, AHK Filename, Please enter the filename of the AHK to run:
;if they forgot to add ".ahk", then add it
filename := EnsureEndsWith(filename, ".ahk")
;if it doesn't exist, get rid of spaces and check again
if NOT FileExist(filename)
filename:=StringReplace(filename, " ")
if NOT FileExist(filename)
return
Run %filename%
return
;Print Screen and Save to Disk
^PrintScreen:: SaveScreenShot("KeyPress")
!PrintScreen:: SaveScreenShot("KeyPress", "dropbox", "activeWindow")
AppsKey & PrintScreen:: SaveScreenShot("KeyPress")
;Insert Date / Time Hotstrings
:*:]0d:: ; With leading zeros and no slashes
FormatTime CurrentDateTime,, MMddyyyy
SendInput %CurrentDateTime%
return
:*:]d:: ; This hotstring replaces "]d" with the current date and time via the commands below.
FormatTime CurrentDateTime,, ShortDate
SendInput %CurrentDateTime%
return
:*:]t::
FormatTime CurrentDateTime,, Time
SendInput %CurrentDateTime%
return
;Paste without formatting
^+v:: SendViaClipboard(Clipboard)
;Press the play/pause button in last.fm
;Play pause button on work keyboard
SC122::
Launch_Media::
Run, PlayPauseMusic.ahk
return
;Record the artist name in the log so we can remove them from the last.fm library later
AppsKey & b::
SetTitleMatchMode, 2
WinGetTitle, titletext, Last.fm
InputBox, inputtext, User, Whose account should we remove this artist from?
logPath=C:\My Dropbox\Public\logs
FileCreateDir, %logPath%
FileAppend, %titletext%`n%inputtext%`n`n, %logPath%\removeartist.log
return
/*
;FIXME odd... both come through as 13-045 on the VM and all keys come through as 90-045 on the parent
;SC169:: Send, ^{Alt}{vkA7sc169}
;SC16A:: Send, ^{Alt}{vkA6sc16A}
AppsKey:: Send, ^{Alt}
vk13sc045:: Send, {Ctrl Down}{Alt}{Ctrl Up}
vk5Dsc15D:: Send, {Ctrl Down}{Alt}{Ctrl Up}
vk90sc045:: Send, {Ctrl Down}{Alt}{Ctrl Up}
*/
;FIXME the code flow here is kinda crappy
;Show the current track from last.fm
AppsKey & SC122::
AppsKey & Launch_Media::
SetTitleMatchMode, RegEx
DetectHiddenWindows, On
titletext := WinGetTitle("(Last.fm|Power FM)")
DetectHiddenWindows, Off
PowerIsStreamingInWMP:=WinExist("Windows Media Player")
if (titletext=="89.7 Power FM - Powered by ChristianNetcast.com - Opera" OR PowerIsStreamingInWMP)
{
playlist:=UrlDownloadToVar("http://on-air.897powerfm.com/")
playlist:=RegExReplace(playlist, "(`r|`n)", " ")
RegExMatch(playlist, "Now Playing.*What`'s Played Recently", outputVar)
outputVar:=RegExReplace(outputVar, "(Now Playing|What`'s Played Recently)", "")
outputVar:=RegExReplace(outputVar, "<.*?>", "")
outputVar:=RegExReplace(outputVar, " +", " ")
debug(outputVar)
return
}
if (titletext=="")
WinGetTitle, titletext, ahk_class QWidget
if (titletext=="")
WinGetTitle, titletext, foobar2000
if (titletext<>"")
{
titletext:=RegExReplace(titletext, "\[foobar2000.*$")
titletext:=RegExReplace(titletext, " \[Indie.Rock Playlist.*?\]")
titletext:=StringReplace(titletext, " - Last.fm - Opera")
Debug(titletext)
}
return
AppsKey & q:: Run, temporary.ahk
AppsKey & m:: Run, RecordMacro.ahk
#e::
RunProgram("C:\Program Files\EF Commander Free\EFCWT.EXE")
WinWait, EFLogo
WinClose
return