Disables or enables all or selected hotkeys and hotstrings.
Suspend , OnOffTogglePermit
If blank or omitted, it defaults to Toggle. Otherwise, specify one of the following words:
On: Suspends all hotkeys and hotstrings except those explained in the Remarks section.
Off: Re-enables the hotkeys and hotstrings that were disable above.
Toggle: Changes to the opposite of its previous state (On or Off).
Permit: Does nothing except mark the current subroutine as being exempt from suspension.
[v1.1.30+]: The decimal values 1, 0 and -1 may be used in place of On, Off and Toggle, respectively.
By default, the script can also be suspended via its tray icon or main window.
Any hotkey/hotstring subroutine whose very first line is Suspend (except
Suspend On) will be exempt from suspension. In other words, the hotkey will remain enabled even while suspension is ON. This allows suspension to be turned off via such a hotkey.
The keyboard and/or mouse hooks will be installed or removed if justified by the changes made by this command.
To disable selected hotkeys or hotstrings automatically based on the type of window that is present, use #IfWinActive/Exist.
Suspending a script's hotkeys does not stop the script's already-running threads (if any); use Pause to do that.
When a script's hotkeys are suspended, its tray icon changes to (or to if the script is also paused). This icon change can be avoided by freezing the icon, which is achieved by specifying 1 for the Freeze parameter of the Menu's Icon sub-command. For example:
Menu, Tray, Icon, C:\My Icon.ico, , 1
The built-in variable A_IsSuspended contains 1 if the script is suspended and 0 otherwise.
#IfWinActive/Exist, Pause, Menu, ExitApp
^!s::Suspend ; Ctrl+Alt+S