Page 1 of 1

Malfunctioning of Hotkeys

Posted: 28 Nov 2021, 08:09
by Alexander2
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

Re: Malfunctioning of Hotkeys  Topic is solved

Posted: 28 Nov 2021, 08:14
by mikeyww
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.

Re: Malfunctioning of Hotkeys

Posted: 30 Nov 2021, 12:17
by Alexander2
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.