Hotkeys Docs
API Reference
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
AI/LLM: This documentation page is available in plain markdown format at/hotkeys/latest/docs/framework/lit/reference/classes/HeldKeysController.md
Key hold & held keys API Reference
HeldKeysController
Defined in: controllers/held-keys.ts:26
A Lit ReactiveController that tracks all currently held keyboard keys.
Subscribes to the global KeyStateTracker and triggers host updates whenever keys are pressed or released.
Example#
ts
class KeyDisplay extends LitElement {
private heldKeys = new HeldKeysController(this)
render() {
return html`
<div>
Currently pressed: ${this.heldKeys.value.join(' + ') || 'None'}
</div>
`
}
}Implements#
- ReactiveController
Constructors#
Constructor#
ts
new HeldKeysController(_host): HeldKeysController;Defined in: controllers/held-keys.ts:40
Parameters#
_host#
ReactiveControllerHost
The Lit component that owns this controller.
Returns#
HeldKeysController
Accessors#
value#
Get Signature#
ts
get value(): string[];Defined in: controllers/held-keys.ts:33
Array of currently held key names.
Returns#
string[]
Methods#
hostConnected()#
ts
hostConnected(): void;Defined in: controllers/held-keys.ts:45
Subscribes to the tracker store and updates the internal state when changes occur.
Returns#
void
Implementation of#
ts
ReactiveController.hostConnectedhostDisconnected()#
ts
hostDisconnected(): void;Defined in: controllers/held-keys.ts:59
Unsubscribes from the tracker store and stops tracking the held keys.
Returns#
void
Implementation of#
ts
ReactiveController.hostDisconnected