HSHotkey
TypeObject representing a system-wide hotkey. You should not create these objects directly, but rather, use the methods in hs.hotkey to instantiate these.
Properties
Methods
enable() -> boolean
Enable the hotkey
Declaration
enable() -> boolean
Returns
boolean
True if the hotkey was enabled, otherwise False
Example
const hk = hs.hotkey.bind(["cmd"], "h", () => {})
hk.enable()
disable() -> None
Disable the hotkey
Declaration
disable() -> None
Returns
None
Example
const hk = hs.hotkey.bind(["cmd"], "h", () => {})
hk.disable()
isEnabled() -> boolean
Check if the hotkey is currently enabled
Declaration
isEnabled() -> boolean
Returns
boolean
True if the hotkey is enabled, otherwise False
Example
const hk = hs.hotkey.bind(["cmd"], "h", () => {})
console.log(hk.isEnabled())
delete() -> None
Delete the hotkey (disables and clears callbacks)
Declaration
delete() -> None
Returns
None
Example
const hk = hs.hotkey.bind(["cmd"], "h", () => {})
hk.delete()