-
Notifications
You must be signed in to change notification settings - Fork 0
/
KBDRacer.ahk
93 lines (80 loc) · 2.09 KB
/
KBDRacer.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
I_Icon = KBDRacer.ico
IfExist, %I_Icon%
Menu, Tray, Icon, %I_Icon%
;return
;; ? FROM: https://www.autohotkey.com/boards/viewtopic.php?p=391598&sid=b225a17ae64d8e7fa5ae600b77b5b6f4#p391598
#InstallKeybdhook
#UseHook On
#MaxHotkeysPerInterval 200 ; ? FROM: https://www.autohotkey.com/board/topic/62512-permanently-turn-off-that-annoying-hotkey-limit/
;; * Pressing both r & Up buttons cancels each other.
;; ? Throttle/Gas: r (Up cancels it)
;; ? Hand brake: Space
;; ? Brake/Reverse: Down
~r::
if(GetKeyState("Up", "p"))
SendInput {r up}{Up up}
Return
~Up::
if(GetKeyState("r", "p"))
SendInput {r up}{Up up}
Return
~r up::
if(GetKeyState("Up", "p"))
SendInput {Up down}
Return
~Up up::
if(GetKeyState("r", "p"))
SendInput {r down}
Return
;; * Pressing both e & Left/Right buttons or both f & Left/Right buttons cancel each other.
;; ? Steer left: e (Left or Right cancels it)
;; ? Steer right: f (Left or Right cancels it)
~e::
if(GetKeyState("Left", "p"))
SendInput {e up}{Left up}
if(GetKeyState("Right", "p"))
SendInput {e up}{Right up}
Return
~f::
if(GetKeyState("Left", "p"))
SendInput {f up}{Left up}
if(GetKeyState("Right", "p"))
SendInput {f up}{Right up}
Return
~Left::
if(GetKeyState("e", "p"))
SendInput {e up}{Left up}
if(GetKeyState("f", "p"))
SendInput {f up}{Left up}
Return
~Right::
if(GetKeyState("e", "p"))
SendInput {e up}{Right up}
if(GetKeyState("f", "p"))
SendInput {f up}{Right up}
Return
~e up::
if(GetKeyState("Left", "p"))
SendInput {Left down}
if(GetKeyState("Right", "p"))
SendInput {Right down}
Return
~f up::
if(GetKeyState("Left", "p"))
SendInput {Left down}
if(GetKeyState("Right", "p"))
SendInput {Right down}
Return
~Left up::
if(GetKeyState("e", "p"))
SendInput {e down}
if(GetKeyState("f", "p"))
SendInput {f down}
Return
~Right up::
if(GetKeyState("e", "p"))
SendInput {e down}
if(GetKeyState("f", "p"))
SendInput {f down}
Return
;; ! BSDK