Hotkeys API Reference
- HotkeyManager
- getHotkeyManager
- Hotkey
- HotkeyChord
- HotkeySequence
- RegisterableHotkey
- RegisterableHotkeyChord
- RegisterableHotkeySequence
- RawHotkeyChord
- HotkeyOptions
- HotkeyChordOptions
- HotkeySequenceOptions
- HotkeyOptionsFor
- HotkeyRegistrationHandle
- HotkeyRegistrationView
- HotkeyChordRegistrationView
- HotkeySequenceRegistrationView
- toHotkeyRegistrationView
- HotkeyCallback
- HotkeyCallbackContext
- HotkeyChordCallbackContext
- HotkeySequenceCallbackContext
- HotkeyCallbackContextFor
- HotkeyMeta
- ConflictBehavior
- isHotkeySequence
- simplifyHotkey
- createSequenceMatcher
- DEFAULT_SEQUENCE_TIMEOUT
- hotkey
- HotkeyController
- HotkeyRegistrationsController
- HotkeyControllerChordOptions
- HotkeyControllerCommonOptions
- HotkeyControllerOptions
- HotkeyControllerOptionsFor
- HotkeyControllerSequenceOptions
- HotkeyControllerTarget
App Hotkeys API Reference
- defineAppHotkeys
- AppHotkeysStore
- provideAppHotkeys
- publishAppHotkeysStore
- AppHotkey
- AppHotkeyInput
- AppHotkeyOptions
- AppHotkeyListItem
- AppHotkeyStatus
- AppHotkeysState
- AppHotkeysStoreOptions
- CustomHotkeys
- Register
- AppHotkeyId
- RegisteredAppHotkeys
- isAppHotkey
- isCustomHotkey
- resolveAppHotkey
- AppHotkeysController
- AppHotkeyControllerOptions
Key hold & held keys API Reference
Hotkey Recorder API Reference
- HotkeyRecorder
- HotkeyRecorderOptions
- HotkeyChordRecorderOptions
- HotkeySequenceRecorderOptions
- HotkeyRecorderState
- HotkeyRecorderCommitKeys
- HotkeyRecorderValidationContext
- HotkeyChordRecorderValidationContext
- HotkeySequenceRecorderValidationContext
- RecorderOptions
- RecorderRejection
- RecorderKeyMode
- findHotkeyConflicts
- HotkeyConflict
- HotkeyConflictOptions
- HotkeyRecorderController
Normalization & format API Reference
- formatForDisplay
- FormatDisplayOptions
- DisplayHotkey
- DisplayHotkeyChord
- formatHotkey
- normalizeHotkey
- parseHotkey
- parseKeyboardEvent
- ParsedHotkeyChord
- matchesKeyboardEvent
- areHotkeysEqual
- validateHotkey
- checkHotkey
- assertValidHotkey
- ValidationResult
- ValidatableHotkey
- LogicalKey
- PhysicalKey
- PhysicalKeyCode
- KEY_DISPLAY_SYMBOLS
- PUNCTUATION_KEY_DISPLAY_LABELS
- MAC_MODIFIER_SYMBOLS
- MAC_MODIFIER_LABELS
- WINDOWS_MODIFIER_LABELS
- LINUX_MODIFIER_LABELS
- MODIFIER_ALIASES
- MODIFIER_ORDER
- MODIFIER_KEYS
hotkey
Call Signature#
function hotkey<T>(hotkey, options?): HotkeyDecorator;Defined in: decorators/hotkey.ts:48
Decorator that registers a hotkey on the element when it connects and unregisters when it disconnects: a chord such as 'Mod+S', a sequence such as ['G', 'G'], or an app hotkey. Uses HotkeyController under the hood.
Type Parameters#
T#
T extends AppHotkey<string, HotkeyChord | HotkeySequence | null>
Parameters#
hotkey#
T
The chord, sequence, or app hotkey to listen for.
options?#
Optional registration options (target, platform, enabled, etc.).
Returns#
HotkeyDecorator
A method decorator for use on LitElement methods.
Example#
class MyElement extends LitElement {
@hotkey('Mod+S')
save() { this.doSave() }
@hotkey(['G', 'G'], { timeout: 500 })
goToTop() { window.scrollTo(0, 0) }
}Call Signature#
function hotkey<T>(hotkey, options?): HotkeyDecorator<HotkeyCallbackContextFor<T>>;Defined in: decorators/hotkey.ts:52
Decorator that registers a hotkey on the element when it connects and unregisters when it disconnects: a chord such as 'Mod+S', a sequence such as ['G', 'G'], or an app hotkey. Uses HotkeyController under the hood.
Type Parameters#
T#
T extends RegisterableHotkey
Parameters#
hotkey#
T
The chord, sequence, or app hotkey to listen for.
options?#
Optional registration options (target, platform, enabled, etc.).
Returns#
HotkeyDecorator<HotkeyCallbackContextFor<T>>
A method decorator for use on LitElement methods.
Example#
class MyElement extends LitElement {
@hotkey('Mod+S')
save() { this.doSave() }
@hotkey(['G', 'G'], { timeout: 500 })
goToTop() { window.scrollTo(0, 0) }
}