Search code examples
keyboardautohotkeycapslock

Autohotkey Control + Capslock issue


I am using Autohotkey to make it so that you have to hit Shift + CapsLock in order to activate capslock. Then just pressing capslock gets you out of capslock. I love this script, however, when I switch tabs in chrome using Control + Tab, I sometimes end up hitting Contorl + Capslock, which activates capslock. Here is my code:

; Only allow capslock if it's shift-capslock
$SC03a::
GetKeyState,caps,CapsLock,T

if caps = D
    SetCapsLockState,Off
return

I don't know how to get around this. Any ideas?


Solution

  • Only allow capslock if it's shift-capslock:

       CapsLock::SetCapslockState AlwaysOFF
       +CapsLock::SetCapslockState AlwaysON