So I have these two scripts
caps-hjkl.ahk, and
game-specific-caps-mappings.ahk. The first script there works as expected:
Code: Select all
; Disable default CapsLock functionality
SetCapsLockState, AlwaysOff
; Post Esc if pressed alone
CapsLock::
KeyWait, CapsLock
If (A_PriorKey="CapsLock")
Send {Esc}
return
; Map CapsLock modified hotkeys
#If, GetKeyState("CapsLock", "P")
h::Left
j::Down
k::Up
l::Right
In the second script, want to override CapsLock mappings for very specific active windows:
Code: Select all
#IfWinActive ahk_class Starcraft
CapsLock::Send {Insert}
#IfWinActive ahk_class AOE2
CapsLock::Send {Pause}
However, I can't get the two scripts to play together nicely. It seems whichever order they are executed/opened in, affects precedence. I know I could do this if I combined the scripts into one, but I'm trying to keep functionality separate so that I can share the first script on github, but still have my custom window specific overrides locally. Any idea if this is possible?