Skip to content

Instantly share code, notes, and snippets.

@matthayter
Last active August 1, 2017 12:40
Show Gist options
  • Save matthayter/dabd88acacb7efa91ef460e0d4289c2d to your computer and use it in GitHub Desktop.
Save matthayter/dabd88acacb7efa91ef460e0d4289c2d to your computer and use it in GitHub Desktop.
Autohotkey: Use Caps Lock as both CTRL and Escape: Hold for CTRL; tap for Escape.
SetCapsLockState Off
*CapsLock::
key=
Input, key, B C L1 T1, {Esc}
if (ErrorLevel = "Max")
if key {
Send {Ctrl Down}
Send {Blind}%key%
}
KeyWait, CapsLock
Return
*CapsLock up::
Send {Ctrl Up}
if not key {
if (A_TimeSincePriorHotkey < 1000)
Send, {Esc 2}
}
key=
Return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment