A pretty simple AutoHotkey_L example, hope will be useful to some1.
I rely on GetKeyState() and a Loop (run every 30ms)
P.S. I'm new to AHK scripts so avoid tech. questions.
Works for me, hopefully will for You also, but don't bash me if it doesn't.
#Persistent
HotKeys := Object(), HotKeyStates := Object()
; Config HotKeys here..
HotKeys["Up"] := "w"; arrows -> WSAD
HotKeys["Down"] := "s"
HotKeys["Left"] := "a"
HotKeys["Right"] := "d"
HotKeys["Backspace"] := "Esc"
HotKeys["Home"] := "c"; Show character
HotKeys["End"] := "f"; Inventory
HotKeys["NumpadDot"] := "r"; Show path to quest
HotKeys["Delete"] := "q"; Toggle 1H/2H
HotKeys["Numpad0"] := "e"; Interact
HotKeys["Numpad1"] := "1"; Power 1
; Mute default keys
for key in HotKeys {
Hotkey, %key%, mute
}
SetTimer, checkKeysStates, 30
return
; Mouse binds work great without workarounds
XButton1::Space; block key
XButton2::1 ; power 1 key
checkKeysStates:
{
for key1, key2 in HotKeys {
if (GetKeyState(key1, "L")) {
if (HotKeyStates[key1] != 1) {
Send, {%key2% down}
HotKeyStates[key1] := 1
}
} else {
if (HotKeyStates[key1] == 1) {
Send, {%key2% up}
HotKeyStates[key1] := 0
}
}
}
return
}
mute:
return