Skip to content

Instantly share code, notes, and snippets.

@subnut
Created May 24, 2022 18:05
Show Gist options
  • Save subnut/ae48047c9f3155118660941a6df2cc21 to your computer and use it in GitHub Desktop.
Save subnut/ae48047c9f3155118660941a6df2cc21 to your computer and use it in GitHub Desktop.
capsctrl - CapsLock if tapped, Control if held
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
; CapsLock is Left control
CapsLock::LCtrl
CapsLock up::
Send, {LCtrl up}
if (A_TimeSincePriorHotkey < 150)
Send, {Blind}{CapsLock}
; SetCapsLockState % !GetKeyState("CapsLock", "T")
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment