HSHotkeyModal
TypeA modal hotkey group returned by hs.hotkey.createModal(). Hotkeys bound to the modal via bind() are only enabled while the modal is active (i.e. between enter() and exit()).
Properties
Methods
bind(mods, key, callbackPressed, callbackReleased) -> HSHotkeyModal
Bind a hotkey to this modal. The hotkey is only enabled while the modal is active.
Declaration
bind(mods, key, callbackPressed, callbackReleased) -> HSHotkeyModal
Parameters
| Name | Type | Description |
|---|---|---|
| mods | string[] | - Modifier keys for the hotkey (e.g. ["cmd", "shift"]) |
| key | string | - Key name for the hotkey (e.g. "h") |
| callbackPressed | Function|null | - Called when the hotkey is pressed, or null |
| callbackReleased | Function|null | - Called when the hotkey is released, or null |
Returns
HSHotkeyModal
This modal, for chaining
enter() -> HSHotkeyModal
Enter the modal: its trigger (if any) is disabled and its bound hotkeys are enabled.
Declaration
enter() -> HSHotkeyModal
Returns
HSHotkeyModal
This modal, for chaining
exit() -> HSHotkeyModal
Exit the modal: its bound hotkeys are disabled and its trigger (if any) is re-enabled.
Declaration
exit() -> HSHotkeyModal
Returns
HSHotkeyModal
This modal, for chaining
destroy() -> None
Destroy the modal, along with its trigger and all hotkeys bound to it.
Declaration
destroy() -> None
Returns
None