Namespace: GlobalHotkey

GlobalHotkey

The GlobalHotkey module can register/unregister a global hotkeys.

Methods

(async) isRegistered(hotkey) → {Promise.<boolean>}

Checks if a given hotkey has been registered

Parameters:
Name Type Description
hotkey string

a hotkey string

Tutorials:
Returns:
Type
Promise.<boolean>

(async) register(hotkey, listener) → {Promise.<void>}

Registers a global hotkey with the operating system.

Parameters:
Name Type Description
hotkey string

a hotkey string

listener function

called when the registered hotkey is pressed by the user.

Tutorials:
Returns:
Type
Promise.<void>

(async) unregister(hotkey) → {Promise.<void>}

Unregisters a global hotkey with the operating system.

Parameters:
Name Type Description
hotkey string

a hotkey string

Tutorials:
Returns:
Type
Promise.<void>

(async) unregisterAll() → {Promise.<void>}

Unregisters all global hotkeys for the current application.

Tutorials:
Returns:
Type
Promise.<void>