Created
October 13, 2014 06:57
-
-
Save tiansh/c386a91dc2d6d0584920 to your computer and use it in GitHub Desktop.
Hold CapsLock to switch letter case, press CapsLock works as Esc
This file contains hidden or 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
#SingleInstance force | |
#MaxHotkeysPerInterval 100 | |
#UseHook | |
#NoTrayIcon | |
Process, Priority,, Realtime | |
SetKeyDelay -1 | |
tli := false | |
cli := false | |
*CapsLock:: | |
if (!pli) { | |
pli := true | |
cli := true | |
Sleep 500 | |
if (cli) { | |
cli := false | |
if (GetKeyState("CapsLock", "T")) { | |
SetCapsLockState, Off | |
} else { | |
SetCapsLockState, On | |
} | |
} | |
} | |
return | |
*CapsLock up:: | |
pli := false | |
if (GetKeyState("CapsLock", "T")) { | |
if (cli) { | |
Send {Esc} | |
SetCapsLockState, Off | |
} | |
} | |
cli := false | |
return | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment