A_MaxHotkeysPerInterval

The A_MaxHotkeysPerInterval and A_HotkeyInterval variables control the rate of hotkey activations beyond which a warning dialog will be displayed.

VariableMeaningDefault ValueType
A_MaxHotkeysPerInterval The maximum number of hotkeys that can be pressed within the interval without triggering a warning dialog. 70 Integer
A_HotkeyInterval The length of the interval in milliseconds. 2000 Integer

Remarks

These built-in variables should usually be assigned values when the script starts (if the default values are not suitable), but the script can get or set their values at any time.

Care should be taken not to make the above 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:

To disable the warning dialog entirely, assign A_HotkeyInterval := 0.

Examples

Allows a maximum of 200 hotkeys to be pressed within 2000 ms without triggering a warning dialog.

A_HotkeyInterval := 2000  ; This is the default value (milliseconds).
A_MaxHotkeysPerInterval := 200