Namespace: GlobalHotkey

GlobalHotkey

The Global Hotkey allows the registration and unregistration of given hotkeys at the OS level, meaning a Window/Application will receive the events regardless of focused state.

Synonym: fin.desktop.GlobalHotkey

Asynchronous Methods

Methods

(static) addEventListener(type, listener, callbackopt, errorCallbackopt)

Registers an event listener on the specified event.

Parameters:
Name Type Attributes Description
type string

The type of the event.

listener function

Called whenever an event of the specified type occurs. It is passed an event object containing information related to the event.

callback function <optional>

called if the method succeeds.

errorCallback function <optional>

called if the method fails. The reason for failure is passed as an argument.

Tutorials:

(static) isRegistered(callbackopt, errorCallbackopt)

Checks if a given hotkey has been registered

Parameters:
Name Type Attributes Description
callback function <optional>

called if the method succeeds.

errorCallback function <optional>

called if the method fails. The reason for failure is passed as an argument.

Tutorials:

(static) register(hotkey, callbackopt, errorCallbackopt)

Registers a global hotkey with the operating system.

Parameters:
Name Type Attributes Description
hotkey string

See tutorial for more details.

callback function <optional>

called if the method succeeds.

errorCallback function <optional>

called if the method fails. The reason for failure is passed as an argument.

Tutorials:

(static) removeEventListener(type, listener, callbackopt, errorCallbackopt)

Removes a previously registered event listener from the specified event.

Parameters:
Name Type Attributes Description
type string

The type of the event.

listener function

Called whenever an event of the specified type occurs. It is passed an event object containing information related to the event.

callback function <optional>

called if the method succeeds.

errorCallback function <optional>

called if the method fails. The reason for failure is passed as an argument.

Tutorials:

(static) unregister(hotkey, callbackopt, errorCallbackopt)

Unregisters a global hotkey with the operating system.

Parameters:
Name Type Attributes Description
hotkey string

See tutorial for more details.

callback function <optional>

called if the method succeeds.

errorCallback function <optional>

called if the method fails. The reason for failure is passed as an argument.

Tutorials:

(static) unregisterAll(hotkey, callbackopt, errorCallbackopt)

Unregisters all global hotkeys for the current application.

Parameters:
Name Type Attributes Description
hotkey string

See tutorial for more details.

callback function <optional>

called if the method succeeds.

errorCallback function <optional>

called if the method fails. The reason for failure is passed as an argument.

Tutorials: