d4v1dAHK wrote: ↑10 Feb 2023, 22:42
I realized something new though, it only clicks CapsLock if my CapsLock is on. If my CapsLock is not on, it won't register the input.
Yes, Capslock is a special key with its own behaviour.
On my keyboard layout (it might differ for yours), you'll get a
!, if you press the
1 key, while Capslock is ON.
that's why if I
while Capslock is ON, AHK tries to counter that by first releasing Capslock, sending
1, and then restoring the Capslock state to ON.
So
1 actually gets sent, not
!.
If you want to keep Capslock ON no matter what you send, then you have to use some different send mode.
You could try
Text mode (AHK v1.1.27+):
Now, AHK uses a different send mode to send 1 (not
!), without affecting the Capslock state.
No idea, if your game will like that different send method.
If your game already accounts for Capslock ON, and then actually expects
! instead of
1, you could try
blind mode:
This won't release an activated Capslock, and it will then send
! instead of
1. Or whatever a shifted 1 results in on your keyboard layout.
After all, I guess you could try to define different hotkey variants for different Capslock states, with
#If...