A_MaxHotkeysPerInterval and A_HotkeyInterval are built-in variables that control the rate of hotkey activations beyond which a warning dialog will be displayed.
A_MaxHotkeysPerInterval can be used to get or set an integer representing the maximum number of hotkeys that can be pressed within the interval without triggering a warning dialog.
A_HotkeyInterval can be used to get or set an integer representing the length of the interval in milliseconds.
The default settings are 70 (hotkeys) for A_MaxHotkeysPerInterval and 2000 (ms) for A_HotkeyInterval.
These built-in variables should usually be assigned values when the script starts (if the default settings are not suitable), but the script can get or set their values at any time.
Care should be taken not to make the setting too lenient because if you ever inadvertently introduce an infinite loop of keystrokes (via a Send function that accidentally triggers other hotkeys), your computer could become unresponsive due to the rapid flood of keyboard events.
As an oversimplified example, the hotkey ^c::Send "^c"
would produce an infinite loop of keystrokes. To avoid this, add the $ prefix to the hotkey definition (e.g. $^c::
) so that the hotkey cannot be triggered by the Send function.
The limit might be reached by means other than an infinite loop, such as:
WheelLeft::
and WheelRight::
.To disable the warning dialog entirely, use A_HotkeyInterval := 0
.