My hotkey script is clunky
I'm playing an old computer game that uses a numpad for movement but I don't have the numpad on my keyboard. I want to set it up such that a combination of Up|Down + Left|Right sends the correct numpad instruction for diagonal movement.
I managed to hack together something that functions, but I'd really appreciate it if someone could help me improve this script (V2).
#HotIf WinActive("Civilization II")
Up & Right::Send "{Numpad9}"
Right & Up::Send "{Numpad9}"
Up & Left::Send "{Numpad7}"
Left & Up::Send "{Numpad7}"
Down & Right::Send "{Numpad3}"
Right & Down::Send "{Numpad3}"
Down & Left::Send "{Numpad1}"
Left & Down::Send "{Numpad1}"
$Up::Send "{Up}"
$Down::Send "{Down}"
$Left::Send "{Left}"
$Right::Send "{Right}"
Space::Enter
What I'd like is a script that works quite differently than the one I've written. In addition to being ugly and Basically:
Trigger: Any arrow key is pressed
IF: Key is released before another arrow key is pressed:
send the normal keystroke for that key
ELSE:
IF: GetKeyState("Numlock", "T") is False
Toggle Numlock
Send the Numpad key appropriate to the arrow combinations