-
Notifications
You must be signed in to change notification settings - Fork 0
/
AutoHotkeyV2.ahk
210 lines (174 loc) · 3.98 KB
/
AutoHotkeyV2.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
#Requires AutoHotkey v2.0
Persistent ; This keeps the script running permanently.
#SingleInstance Force
#Warn ; Enable warnings to assist with detecting common errors.
InstallKeybdHook()
SendMode("Input") ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir(A_ScriptDir) ; Ensures a consistent starting directory.
SetCapsLockState("AlwaysOff")
GroupAdd("Browsers", "ahk_class MozillaWindowClass")
; GroupAdd, Browsers, ahk_class Chrome_WidgetWin_1
GroupAdd("Browsers", "ahk_exe chrome.exe")
GroupAdd("Browsers", "ahk_exe Discord.exe")
GroupAdd("Fps", "ahk_class UnrealWindow")
GroupAdd("Fps", "ahk_class TankWindowClass")
GroupAdd("Fps", "ahk_class techland_game_class")
GroupAdd("Fps", "ahk_exe HeroesOfTheStorm_x64.exe")
GroupAdd("Fps", "ahk_class Respawn001")
GroupAdd("Fps", "ahk_exe RelicCardinal_ws.exe")
GroupAdd("Fps", "ahk_exe Code.exe")
;;; Prefixes:
;;; ! Alt
;;; ^ Ctrl
;;; + Shift
;;; # Windows
;;; Browser Specific
#HotIf WinActive("ahk_group Browsers", )
!1:: Send("^1")
!2:: Send("^2")
!3:: Send("^3")
!4:: Send("^4")
!5:: Send("^5")
!6:: Send("^6")
!7:: Send("^7")
!t:: Send("^t")
+!t:: Send("+^t")
!w:: Send("^w")
!l:: Send("^l")
!r:: Send("^r")
![:: Send("^{PgUp}")
!]:: Send("^{PgDn}")
!+[:: Send("^{PgUp}")
!+]:: Send("^{PgDn}")
^[:: Send("^{PgUp}")
^]:: Send("^{PgDn}")
^+[:: Send("^{PgUp}")
^+]:: Send("^{PgDn}")
!Left:: SendInput("!{Left}")
!Right:: SendInput("!{Right}")
!LButton:: SendInput("^{LButton}")
!\:: Send("^\")
#HotIf
;;; Unity Specific
#HotIf WinActive("ahk_exe Unity.exe", )
!p:: Send("^p")
!+p:: Send("^+p")
#HotIf
;;; Valheim
#HotIf WinActive("ahk_exe valheim.exe", )
+1:: Send(6)
+2:: Send(7)
+3:: Send(8)
#HotIf
;;; Valorant
#HotIf WinActive("ahk_exe VALORANT-Win64-Shipping.exe", )
LWin::[
#HotIf
#HotIf WinActive("ahk_exe helldivers2.exe")
XButton2::w
#HotIf
;;; Windows key rebinding
;#IfWinActive ahk_group FPS
;LWin::[
;#IfWinActive
;;; General Maclike Hotkeys, when not in a Fps game
#HotIf !WinActive("ahk_group Fps", )
!c:: Send("^c")
!x:: Send("^x")
!f:: Send("^f")
!g:: Send("^g")
!+g:: Send("^+g")
!v:: Send("^v")
!z:: Send("^z")
!+z:: Send("^+z")
!s:: Send("^s")
!w:: Send("^w")
#Left:: SendInput("^{Left}")
#Right:: SendInput("^{Right}")
#+Left:: SendInput("^+{Left}")
#+Right:: SendInput("^+{Right}")
;; Cursor Movement
!Left:: SendInput("{Home}")
!Right:: SendInput("{End}")
!+Left:: SendInput("+{Home}")
!+Right:: SendInput("+{End}")
!a:: SendInput("^a")
!Down:: SendInput("^{End}")
!Up:: SendInput("^{Home}")
!+Down:: SendInput("^+{End}")
!+Up:: SendInput("^+{Home}")
;;; Alt+H To Minimize
!h:: WinMinimize("a")
;; Alt-q to Quit
!q:: Send("!{F4}")
#HotIf
; Backtick key as escape
`::Escape
+`::+`
*CapsLock::return
;; Capslock Bindings
#HotIf GetKeyState("CapsLock", "P") ; Following hotkeys are enabled when caps is held
w::Up
a::Left
s::Down
d::Right
h::Left
j::Down
k::Up
l::Right
z::Volume_Down
x::Volume_Up
e::Send "{Media_Play_Pause}"
r::Send "{Media_Prev}"
t::Send "{Media_Next}"
c::Send "^{c}"
Space::Delete
Tab::SendInput "^{Tab}"
`::`
;; Function Keys
1::F1
2::F2
3::F3
4::F4
5::F5
6::F6
7::F7
8::F8
9::F9
0::F10
-::F11
=::F12
#HotIf
;; LGTV control
global LGTV_Companion_path := "C:\Program Files\LGTV Companion\LGTV Companion.exe"
global LGTVcli_path := "C:\`"Program Files\LGTV Companion\LGTVcli.exe`""
^F1::
{
Run LGTV_Companion_path " -request com.webos.service.audio/master/volumeDown",,"Hide"
return
}
^F2::
{
Run LGTV_Companion_path " -request com.webos.service.audio/master/volumeUp",,"Hide"
return
}
PGDN::
{
Run LGTV_Companion_path " -request com.webos.service.audio/master/volumeDown",,"Hide"
return
}
PGUP::
{
Run LGTV_Companion_path " -request com.webos.service.audio/master/volumeUp",,"Hide"
return
}
^+F3::
{
Run LGTV_Companion_path " -setHdmi 3",,"Hide"
return
}
^+F4::
{
Run LGTV_Companion_path " -setHdmi 4",,"Hide"
return
}