The good part about this is that the CapsLock functionality is preserved. Just double click CapsLock!
Code: Select all
CapsLock:: {
start := A_TickCount ; run once
KeyWait('CapsLock') ; wait for Capslock to be released
if (A_TickCount - start < 200) ; in 0.2 seconds
and KeyWait('CapsLock', 'D T0.2') ; and pressed again within 0.2 seconds
and (A_PriorKey = 'CapsLock') ; block other keys
SetCapsLockState !GetKeyState('CapsLock', 'T')
}
*CapsLock:: return ; This forces capslock into a modifying key.
#HotIf GetKeyState("CapsLock", "P")
Alt:: return ; Disables Alt menu when CapsLock + Alt is pressed.
LWin:: return ; Suppresses the Start Menu.
RWin:: return
; ---- Your hotkeys go here! ----
q:: MsgBox "You pressed CapsLock + q"
^w:: MsgBox "You pressed CapsLock + Control + w"
#HotIf