Name
SetCXKey -- set global hotkey (V11.0)
Synopsis
SetCXKey(key$)
Library
amiga

Platforms
AmigaOS and compatibles only

Function
This function can be used to install the key or key combination specified by key$ as a global hotkey for your application. Whenever the user presses the specified key or key combination, your application will receive a Hotkey event which you can listen to through the InstallEventHandler() function. Passing an empty string to this function will unset the current global hotkey.

Note that global hotkeys are managed through AmigaOS's commodities system which is why this function will not work if you have disabled commodities support for your application by setting the NoCommodity tag to True in the @OPTIONS preprocessor command.

Inputs
key$
key or key combination to set as the global hotkey or an empty string to remove the global hotkey
Example
SetCXKey("alt x")
The above code sets the global hotkey to ALT+X which means that whenever the user presses this key combination, your script will receive a Hotkey event.

Show TOC