Caps Lock behavior is different

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Sieceres
Posts: 12
Joined: 06 Sep 2018, 05:16

Caps Lock behavior is different

Post by Sieceres » 30 Mar 2023, 02:11

So I have the following code:

Code: Select all

ToggleCaps := 0

^Capslock::
SetCapsLockState, AlwaysOff
Return

+^Capslock::
SetCapsLockState, On
Return
and tons of functions with CapsLock as a modifier, such as:

Code: Select all

Capslock & f:: 
Send ^{Enter} 
Return
I have no idea why the ToggleCaps is there, but that's not what I want to ask about. At some point recently, CapsLock stopped working as a modifier when SetCapsLockState is set to AlwaysOff. Any simple solution for this? I could toggle SetCapsLockState twice in every single hotkey, but I'm sure there's a better way?

User avatar
mikeyww
Posts: 26612
Joined: 09 Sep 2014, 18:38

Re: Caps Lock behavior is different

Post by mikeyww » 30 Mar 2023, 06:22

Hello,

You posted a specific script. Does that script work? If it does, then why not post a different script that demonstrates the problem that you are experiencing?

Your script worked when I tested it here.

Sieceres
Posts: 12
Joined: 06 Sep 2018, 05:16

Re: Caps Lock behavior is different

Post by Sieceres » 30 Mar 2023, 08:20

Sorry if I wasn't being specific enough. When "SetCapsLockState, AlwaysOff" is active, the "Capslock & f" script (and the tens of other functions with CapsLock) does not work, it only sends an F. The hotkey "^Capslock" deactivates the way CapsLock usually works, so pressing CapsLock does nothing. The hotkey used to work though.

User avatar
mikeyww
Posts: 26612
Joined: 09 Sep 2014, 18:38

Re: Caps Lock behavior is different

Post by mikeyww » 30 Mar 2023, 08:32

As I mentioned, you posted a working script instead of your broken one, so it's not very helpful.

If your previous script worked, then I imagine that your change to the script is what broke it, and that change is also not posted here.

Your hotkey subroutine does not disable your ability to continue to work with CapsLock as a hotkey.

Sieceres
Posts: 12
Joined: 06 Sep 2018, 05:16

Re: Caps Lock behavior is different

Post by Sieceres » 30 Mar 2023, 12:21

I don't get why it's not clear. There is no other script and no previous script. This is the way it's always been and it has stopped working. If there hasn't been any change in the way AHK handles it, it must be something with my computer. A bit of a longshot, but maybe I'll try AHK v2 and see if that could fix it for some reason.

User avatar
mikeyww
Posts: 26612
Joined: 09 Sep 2014, 18:38

Re: Caps Lock behavior is different

Post by mikeyww » 30 Mar 2023, 12:38

So I have the following code, and tons of functions with CapsLock as a modifier.
This led me to believe that your real script differs from what you posted. In any case, I am not reproducing your issue at my end, so perhaps others will be more helpful. Best of luck.

Post Reply

Return to “Ask for Help (v1)”