Last active
July 3, 2021 15:57
-
-
Save aqt/79bacae3526bb5a28859717a7a14169a to your computer and use it in GitHub Desktop.
Swap the behavior of Caps Lock with more useful functions; Use it as an Escape key and/or provide comfortable access to the arrow keys
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; This script disables the normal behavior of Caps Lock, | |
; and makes the key more useful for programmers. | |
; | |
; Caps Lock + h/j/k/l -- Arrow keys | |
; Just Caps Lock -- Escape (on key released) | |
; Both shift keys -- Toggle Caps Lock (in case it's needed) | |
#SingleInstance force | |
SetCapsLockState, AlwaysOff | |
is_tap := 1 | |
LShift & RShift:: | |
RShift & LShift:: | |
SetCapsLockState % !GetKeyState("CapsLock", "T") | |
return | |
CapsLock & h:: | |
is_tap := 0 | |
Send {Left} | |
return | |
CapsLock & j:: | |
is_tap := 0 | |
Send {Down} | |
return | |
CapsLock & k:: | |
is_tap := 0 | |
Send {Up} | |
return | |
CapsLock & l:: | |
is_tap := 0 | |
Send {Right} | |
return | |
CapsLock up:: | |
if is_tap | |
Send {Esc} | |
is_tap := 1 | |
return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment