ElectronGlobalShortcut.register method
ElectronGlobalShortcut › register
Unofficial
Registers a global shortcut ofaccelerator. The callback is called when the registered shortcut is pressed by the user.When the accelerator is already taken by other applications, this call will silently fail.
Signature:
register(accelerator: string, callback: () => void): booleanParameters:
| Parameter | Type | Description |
|---|---|---|
| accelerator | string | The accelerator to register. |
| callback | () => void | Called when the registered shortcut is pressed. |
Returns: boolean — Whether or not the shortcut was registered successfully.