Malfunctioning of Hotkeys Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Alexander2
Posts: 348
Joined: 27 Apr 2019, 17:38

Malfunctioning of Hotkeys

Post by Alexander2 » 28 Nov 2021, 08:09

I want to learn why hotkeys sometimes stop functioning without any apparent reason after they are accidentally held instead of being simply pressed quickly.

When I quickly press LControl & RControl while the following sample script is running, the execution of the “While” operation starts. When the same combination of keys is quickly pressed again, the “While” operation stops normally, as intended in the script.

However, if I press and hold LControl & RControl for a few seconds, this hotkey stops functioning, so that it subsequently becomes impossible to stop the execution of the “While” operation with this hotkey.

Code: Select all

#MaxThreadsPerHotkey 2
LControl & RControl::
#MaxThreadsPerHotkey 1
on := !on
While on
{
SoundBeep
}
Return

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

Re: Malfunctioning of Hotkeys  Topic is solved

Post by mikeyww » 28 Nov 2021, 08:14

I'm not sure, but you might have exceeded the thread maximum at that point. In some situations like this, adding a KeyWait to the bottom of the hotkey routine can fix the problem.

Alexander2
Posts: 348
Joined: 27 Apr 2019, 17:38

Re: Malfunctioning of Hotkeys

Post by Alexander2 » 30 Nov 2021, 12:17

mikeyww wrote:
28 Nov 2021, 08:14
I'm not sure, but you might have exceeded the thread maximum at that point. In some situations like this, adding a KeyWait to the bottom of the hotkey routine can fix the problem.
Thank you. I have added KeyWait to the bottom of the script, and the hotkey no longer stops working.

Post Reply

Return to “Ask for Help (v1)”