An array of modifier key strings. Supports generic names (cmd, shift, alt,
The key name or character (e.g., "a", "space", "f1")
Called when the key combination is pressed, or null
Called when the key combination is released, or null
An HSEventTapHotkey object, or null if binding failed
Bind a keyboard shortcut using an event tap. Unlike
hs.hotkey.bind(), this supports thefnmodifier and left/right modifier key distinction (e.g.leftCmd,rightAlt). The hotkey is active immediately and consumes (suppresses) the key events. It's important to note that this a much heavier-weight tool thanhs.hotkey- every single key you press will be examined by Hammerspoon to see if it matches one of the EventTap hotkeys (wherehs.hotkeyrelies on macOS to efficiently deliver only matching keypresses). Please consider this when choosing to usehs.eventtapfor hotkeys. Requires Accessibility permission.ctrl,fn) and side-specific names (leftCmd,rightCmd,leftAlt,rightAlt,leftCtrl,rightCtrl,leftShift,rightShift).