

Tn: Specify the letter T followed by a the number of threads to allow for this hotkey as described in #MaxThreadsPerHotkey. If the P option is omitted when creating a hotkey, 0 will be used. Pn: Specify the letter P followed by the hotkey's thread priority. Specify B0 (B with the number 0) to disable this type of buffering. This is typically used to create a hotkey in an initially-disabled state.ī or B0: Specify the letter B to buffer the hotkey as described in #MaxThreadsBuffer. Off: Disables the hotkey if it is currently enabled. On: Enables the hotkey if it is currently disabled. UseErrorLevel: If the command encounters a problem, this option skips the warning dialog, sets ErrorLevel to one of the codes from the table below, then allows the current thread to continue. OptionsĪ string of zero or more of the following letters with optional spaces in between. It is strongly recommended that these values not be used as label names. Toggle: The hotkey is set to the opposite state (enabled or disabled).ĪltTab (and others): These are special Alt-Tab hotkey actions that are described here.Ĭaution: Defining a label named On, Off, Toggle or AltTab (or any variation recognized by this command) may cause inconsistent behavior. No action is taken if the hotkey is already Off. No action is taken if the hotkey is already On. This parameter can also be one of the following special values: To prevent this, include the word ON in Options. Note: If the label or function is specified but the hotkey is disabled from a previous use of this command, the hotkey will remain disabled. This is useful to change only the hotkey's Options. This parameter can be left blank if KeyName already exists as a hotkey, in which case its label will not be changed. Hotkeys can also be defined as functions without the Hotkey command. When the hotkey executes, the function is called without parameters. Other expressions which return objects are currently unsupported. For example, Hotkey #z, %FuncObj%, On or Hotkey #z, % FuncObj, On. : If not a valid label name, this parameter can be the name of a function, or a single variable reference containing a function object. %VarContainingLabelName%), IsLabel(VarContainingLabelName) may be called beforehand to verify that the label exists. The trailing colon(s) should not be included. Both normal labels and hotkey/ hotstring labels can be used, but if the script contains multiple labels with the same name, only the first can be used. The name of the label whose contents will be executed (as a new thread) when the hotkey is pressed.

Prior to, the prefix was ignored when modifying an existing hotkey variant. This prefix affects all variants of the hotkey and cannot be removed. : The use hook ($) prefix can be added to existing hotkeys. However, prior to, the hotkey was not updated if Label was omitted. : If the hotkey variant already exists, its behavior is updated according to whether KeyName includes or excludes the tilde (~) prefix. This name is shared by all variants of the hotkey, and does not change even if the Hotkey command later accesses the hotkey with a different symbol ordering. When a hotkey is first created - either by the Hotkey command or a double-colon label in the script - its key name and the ordering of its modifier symbols becomes the permanent name of that hotkey as reflected by A_ThisHotkey. GetKeyName() can be used to retrieve the standard spelling of a key name. Also, the order of modifier symbols such as ^!+# does not matter.

Esc is not the same as Escape for this purpose). However, the names of keys must be spelled the same as in the existing hotkey (e.g. When specifying an existing hotkey, KeyName is not case sensitive.

a double-colon label), which will cause that hotkey to be updated with the values of the command's other parameters. KeyName can also be the name of an existing hotkey label (i.e. If KeyName already exists as a hotkey, that hotkey will be updated with the values of the command's other parameters. For example, specify #c for the Win+ C hotkey. Name of the hotkey's activation key, including any modifier symbols. Hotkey, KeyName, Label, Options Hotkey, IfWinActive/Exist, WinTitle, WinText Hotkey, If, Expression Hotkey, If, % FunctionObject Hotkey - Syntax & Usage | AutoHotkey HotkeyĬreates, modifies, enables, or disables a hotkey while the script is running.
