Skip to content

Instantly share code, notes, and snippets.

@githusr
githusr / CapsLockCtrlEscape.ahk
Last active April 4, 2025 14:35 — forked from sedm0784/CapsLockCtrlEscape.ahk
AutoHotkey script to map Caps Lock to Escape when it's pressed on its own and Ctrl when used in combination with another key, à la Steve Losh. Adapted from one that does something similar with the Ctrl Key on the Vim Tips Wiki (http://vim.wikia.com/wiki/Map_caps_lock_to_escape_in_Windows?oldid=32281). (Plus contribs from @randy909 & @mmikeww.)
#Requires AutoHotkey 2.0.19 64-bit
#SingleInstance Force
ProcessSetPriority "High"
SetStoreCapsLockMode false
LShift & RShift:: SetCapsLockState !GetKeyState("CapsLock", "T")
*CapsLock:: {
Send "{LCtrl down}"