Skip to content

Instantly share code, notes, and snippets.

@Waester
Created October 19, 2024 23:24
Show Gist options
  • Save Waester/3807fbe299a1e8bdfc9225c4fd834289 to your computer and use it in GitHub Desktop.
Save Waester/3807fbe299a1e8bdfc9225c4fd834289 to your computer and use it in GitHub Desktop.
#Requires AutoHotkey v2
#SingleInstance
ListLines(0), KeyHistory(0)
ProcessSetPriority("High")
for k, v in Map("a","d","w","s")
Set(k, v, 0), Set(v, k, 0), Set(k, v, 1), Set(v, k, 1)
Set(a, b, up) {
if up
return Hotkey("*" a " Up", (
(a, b, *) => (
Hotkey("*" a, "On"), SendInput("{Blind}{" (GetKeyState(b, "P") and !GetKeyState(b) ? a " up}{" b " down}" : a " up}" ))
)
).Bind(a, b)
)
Hotkey("*" a, (
(a, b, *) => (
Hotkey("*" a, "Off"), SendInput("{Blind}{" (GetKeyState(b) ? b " up}{" a " down}" : a " down}" ))
)
).Bind(a, b)
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment