This repository has been archived by the owner on Jul 18, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SupCom_FAF.ahk
503 lines (408 loc) · 7.7 KB
/
SupCom_FAF.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
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
#SingleInstance force
#Persistent ; Keep this script running until the user explicitly exits it.
#Warn ; Enable warnings to assist with detecting common errors.
Layer := 1
keyEnter := 0
SetCapsLockState, AlwaysOff
SetScrollLockState, AlwaysOff
Process, Priority, , A
#HotkeyInterval 2000 ; This is the default value (milliseconds).
#MaxHotkeysPerInterval 500
;#InstallKeybdHook
;#InstallMouseHook
CoordMode, mouse, Screen
{ ;Monitoring Windows
BlockInput, On
KeyHistory
WinGetActiveTitle, Title
WinWait, %Title%
SetKeyDelay 0, 32
Send {Lwin down}{Right}{Right}{Right}{Right}{Lwin up}{LControl down}{k}{LControl Up}
#IfWinExist Event Tester
{
WinClose Event Tester
Run, C:\Program Files (x86)\Thrustmaster\TARGET\Tools\EventTester.exe
WinWait, Event Tester
SetKeyDelay 0, 32
Send {Lwin down}{Right}{Right}{Lwin up}{esc}{esc}{esc}{esc}
Sleep 32
MouseClick, left, 1952, 66
MouseClick, left, 2016, 91
BlockInput, Off
return
}
#IfWinExist
#If WinActive("Event Tester") || WinActive("AHK Studio - C:\Users\hon0_Corsair\Documents\GitHub\AutoHotKey_Script\AutoHotKey_Script.ahk")
{
$F5::
WinActivate %Title%
SetKeyDelay 2000, 32
Send {F5}
return
}
#IfWinActive
{ ; Tray Icon If Pause and/or Suspend
OnMessage(0x111,"WM_COMMAND")
return
WM_Command(wP) {
static Suspend:=65305, Pause:=65306
If (wP = Suspend)
If !A_IsSuspended
Menu, Tray, Icon, Shell32.dll, 132, 1
Else If A_IsPaused
Menu, Tray, Icon, Shell32.dll, 110, 1
Else
Menu, Tray, Icon, %A_AhkPath%
Else If (wP = Pause)
If !A_IsPaused
Menu, Tray, Icon, Shell32.dll, 110, 1
Else If A_IsSuspended
Menu, Tray, Icon, Shell32.dll, 132, 1
Else
Menu, Tray, Icon, %A_AhkPath%
}
}
}
{ ;Before running a Game. Run and/or close Program.
#F1::Suspend, Toggle
#F4::ExitApp
^#!SPACE:: Winset, Alwaysontop, , A ; Toggle Active Windows Always on Top.
#t::
{
If !WinExist("MSI Afterburner")
{
Run, C:\Program Files (x86)\MSI Afterburner\MSIAfterburner.exe
WinWait MSI Afterburner
MsgBox Check Mouse and keyboard profile!
}
Else If !WinExist("Set Timer Resolution")
{
Run, D:\- T�chargements sur D\TimerResolution.exe
WinWait Set Timer Resolution
WinMinimize Set Timer Resolution
WinWait MSI Afterburner
}
Else if WinExist("MSI Afterburner") || WinExist("Set Timer Resolution")
{
WinActivate, MSI Afterburner
WinActivate, Set Timer Resolution
}
return
}
} ;Before running a Game. Run and/or close Program.
{ ;Joystick ID (Use JoyID Program)
;6Joy = T16000L (See JoyID)
;5Joy = Vjoy
}
{ ;Testing
/* ; If prior key ""
{ ; If prior key ""
m::
Send o
if (A_PriorKey = "space")
SendInput {p}
return
}
*/
/* ; Pixel color as as condition
{
!#z::
MouseGetPos, xpos, ypos
;PixelGetColor, color, xpos, xpos
PixelGetColor, color, 1889, 95
;MsgBox The color at X%xpos% Y%ypos% is %color%.
MsgBox The color is %color%.
return
{ ; Numpad1
Numpad1::
PixelGetColor, color, 1889, 95
if color = 0x213A70
{
MouseGetPos, xpos, ypos
BlockInput, On
MouseClick, left, 1732, 171
MouseMove, xpos, ypos
BlockInput, Off
return
}
Else
{
MouseGetPos, xpos, ypos
BlockInput, On
SetKeyDelay 32, 32
Send {NumpadEnter}
MouseClick, left, 1732, 171
MouseMove, xpos, ypos
BlockInput, Off
}
Return
}
}
*/
/* ; On press != on double press != on long press.
$a::
KeyWait, a, T0.1
if (ErrorLevel)
{
Send {b down}
keywait a
Send {b up}
}
else {
KeyWait, a, D T0.1
if (ErrorLevel)
{
Send {a down}
keywait a
Send {a up}
}
else
{
Send {c down}
keywait a
Send {c up}
}
}
KeyWait, a
return
*/
/*
{
$f1::
{
count++
settimer, actions, 333
}
return
actions:
{
if (count = 1)
{
send {F1}
}
else if (count = 2)
{
send {F2}
}
else if (count = 3)
{
send {F3}
}
count := 0
}
return
SetTimer, WatchAxis, 5
return
WatchAxis:
GetKeyState, 6JoyX, 6JoyX ; Get position of X axis.
GetKeyState, 6JoyY, 6JoyY ; Get position of Y axis.
KeyToHoldDownPrev = %KeyToHoldDown% ; Prev now holds the key that was down before (if any).
if 6JoyX > 70
KeyToHoldDown = Right
else if 6JoyX < 30
KeyToHoldDown = Left
else if 6JoyY > 70
KeyToHoldDown = Down
else if 6JoyY < 30
KeyToHoldDown = Up
else
KeyToHoldDown =
if KeyToHoldDown = %KeyToHoldDownPrev% ; The correct key is already down (or no key is needed).
return ; Do nothing.
; Otherwise, release the previous key and press down the new key:
SetKeyDelay -1 ; Avoid delays between keystrokes.
if KeyToHoldDownPrev ; There is a previous key to release.
Send, {%KeyToHoldDownPrev% up} ; Release it.
if KeyToHoldDown ; There is a key to press down.
Send, {%KeyToHoldDown% down} ; Press it down.
return
6Joy1::
If GetKeyState("6Joy2", "P")=1
{
send {d Down}
keywait 6Joy1
send, {d Up}
}
else
if GetKeyState("6joy3", "p")=1
{
send {v Down}
keywait 6Joy1
send, {v Up}
}
Else
{
send {c Down}
keywait 6Joy1
send, {c Up}
}
Return
$f8::
{
count++
settimer, actionsF8, 200
}
return
actionsF8:
{
if (count = 1)
{
send {F8}
}
else if (count = 2)
{
send {F9}
}
else if (count = 3)
{
send {F10}
}
count := 0
}
return
}
*/
}
/*
;Layer checker
z::
ToolTip %Layer%
SetTimer, RemoveToolTip, 2000
return
RemoveToolTip:
SetTimer, RemoveToolTip, Off
ToolTip
return
*/
{ ; Layer modifier
CapsLock:: ;Key disabled by "SetCapsLockState, AlwaysOff".
Layer := 2
if (A_ThisHotkey = A_PriorHotkey && A_TimeSincePriorHotkey < 200)
Layer := 3
KeyWait, CapsLock
Layer := 1
keyEnter = 0
Return
}
~Enter::
keyEnter++
if keyEnter = 1
Layer := 4
else if keyEnter = 3
{
Layer := 1
keyEnter = 0
}
return
{ #if Layer = 1
{ ;Global remapping
SC056:: ; > <
KeyWait SC056, t0.100
t:= A_TimeSinceThisHotkey
If ErrorLevel
{
SendInput {m down}
KeyWait SC056
SendInput {m up}
}
else
{
SendInput {l down}
sleep 32
KeyWait SC056
SendInput {l up}
}
return
;#IfWinActive Forged Alliance
}
{ ; Mouse Wheel Layer 1
~WheelUp::
SetkeyDelay, 0, 32
If GetKeyState("MButton")
send {Home}
;Else
; If (GetKeyState("6Joy1")==1)
; send g
Return
~WheelDown::
SetkeyDelay, 0, 32
If GetKeyState("MButton")
send {End}
;Else
; If GetKeyState("Space")
; send {End}
Return
}
#If ; End of "If Layer = 1".
}
{ #if Layer = 2
{ ; Global remapping
;#IfWinActive Forged Alliance
Up::z
Right::d
Down::s
Left::q
w::b
x::n
c::,
v::;
;#IfWinActive
}
{ ; Mouse Wheel Layer 2
WheelUp::
SetkeyDelay, 0, 32
send {PgUp}
Return
WheelDown::
SetkeyDelay, 0, 32
send {PgDn}
sleep, 100
Return
}
#If ; End of "If Layer = 2".
}
{ #if Layer = 3
{ ; Global remapping
;#IfWinActive Forged Alliance
LButton::F1
RButton::F2
XButton1::F3
XButton2::F4
tab::AppsKey
w::Numpad0
x::Numpad1
c::Numpad2
v::Numpad3
;r::y
;f::h
F8::F9
F9::F10
;#IfWinActive
}
{ ; Mouse Wheel Layer 3
~WheelUp::
SetkeyDelay, 0, 32
If GetKeyState("MButton")
send {PGUP}
else
send {Insert}
;Else
; If (GetKeyState("6Joy1")==1)
; send g
Return
~WheelDown::
SetkeyDelay, 0, 32
If GetKeyState("MButton")
send {PGDN}
Else
send {Del}
;Else
; If GetKeyState("Space")
; send {End}
Return
}
#If ; End of "If Layer = 3".
}
{ #if Layer = 4
#If ; End of "If Layer = 4".
}