#InputLevel

Controls which artificial keyboard and mouse events are ignored by hotkeys and hotstrings.

#InputLevel Level

Parameters

Level

Type: Integer

If omitted, it defaults to 0. Otherwise, specify an integer literal from 0 through 100, in decimal or 0x-prefixed hexadecimal form. A supplied argument is checked when the script is parsed. A malformed, non-integer, or out-of-range value causes a load-time syntax error.

General Remarks

If this directive is unspecified in the script, it will behave as though set to 0.

For an explanation of how SendLevel and #InputLevel are used, see SendLevel.

This directive is positional: it sets the default input level for subsequent hotkeys and the fallback input level for subsequent hotstrings. The initial level is 0. An explicit hotstring input-level default set with the Keysharp-specific #Hotstring In option takes precedence over this fallback. A later #InputLevel directive does not replace that explicit hotstring default.

A hotkey's input level can also be set using the Hotkey function. For example: Hotkey "#z", my_hotkey_sub, "I1"

A hotstring's In option overrides the default for that hotstring. For example, :I1:btw::by the way uses level 1. The Hotstring function accepts the same option when creating or modifying a hotstring.

The input level of a hotkey or non-auto-replace hotstring is also used as the default send level for any keystrokes or button clicks generated by that hotkey or hotstring. Since a keyboard or mouse remapping is actually a pair of hotkeys, this allows #InputLevel to be used to allow remappings to trigger other hotkeys.

AutoHotkey versions older than v1.1.06 behave as though #InputLevel 0 and SendLevel 0 are in effect.

Like other directives, #InputLevel cannot be executed conditionally.

SendLevel, Hotkeys, Hotstrings

Examples

Causes the first hotkey *Numpad0:: to trigger the second hotkey ~LButton::. This would be not the case if the #InputLevel directives are omitted or commented out.

#InputLevel 1
; Use SendEvent so that the script's own hotkeys can be triggered.
*Numpad0::SendEvent "{Blind}{Click Down}"
*Numpad0 up::SendEvent "{Blind}{Click Up}"
#InputLevel 0
; This hotkey can be triggered by both Numpad0 and LButton:
~LButton::MsgBox "Clicked"