Skip to content

Instantly share code, notes, and snippets.

@BosEriko
Created August 9, 2022 19:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BosEriko/ff2c2543900c3764d2d4985d031e1179 to your computer and use it in GitHub Desktop.
Save BosEriko/ff2c2543900c3764d2d4985d031e1179 to your computer and use it in GitHub Desktop.
Overload Capslock
; Map Capslock to Control
; Map press & release of Capslock with no other key to Esc
; Press both shift keys together to toggle Capslock
*Capslock::
Send {Blind}{LControl down}
return
*Capslock up::
Send {Blind}{LControl up}
; Tooltip, %A_PRIORKEY%
; SetTimer, RemoveTooltip, 1000
if A_PRIORKEY = CapsLock
{
Send {Esc}
}
return
RemoveTooltip(){
SetTimer, RemoveTooltip, Off
Tooltip
return
}
ToggleCaps(){
; this is needed because by default, AHK turns CapsLock off before doing Send
SetStoreCapsLockMode, Off
Send {CapsLock}
SetStoreCapsLockMode, On
return
}
LShift & RShift::ToggleCaps()
RShift & LShift::ToggleCaps()
; ^!r::Reload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment