Hello!
I wanted to create a new topic about an issue related to capslock and send input command, but seeing this topic, it seemed appropriate, for me, to post here the issue I discovered.
Code: Select all
#Persistent
#SingleInstance Force
#NoEnv
Hotkey, b, onKeyPress
onKeyPress() {
Text2Send := "Hello world"
SendInput, {text}%Text2Send%
}
If you press B and any other key quickly, when Capslock is ON... After 25-50 times..., and sometimes, even after pressing B and another key just once or twice.... the keyboard input gets blocked and I am no longer able to do anything with the keyboard until I restart the OS session. Closing ahk doesn't unblock the keyboard input.
In my main script, KeyPress OSD , the issue is more apparent. I just have to send a few times the text and the keyboard input remains blocked. In the provided script, you have to try it considerably more [as suggested] to nail this problem. However, I am still able to reproduce the bug within five minutes even with this sample. So, it seems that the more complex or complicated a script is, the issue gets likelier to occur.
The bug applies to Send, SendInput, SendEvent, with {raw}, {text} or without these options.
For some reason, AHK gets stuck in toggling CapsLock. I tried to fix it by using after SetCapslockState ,off.... but without luck.
Thank you .
Ps. I am using Windows 10, x64.
Best regards, Marius.