Defined in: controllers/hotkey-sequence.ts:28
A Lit ReactiveController that registers a keyboard sequence (e.g. Vim-style) when the host element is connected and unregisters it when the host is disconnected.
class MyElement extends LitElement {
private seq = new HotkeySequenceController(this, ['G', 'G'], () => this.goToTop())
constructor() {
super()
this.addController(this.seq)
}
}class MyElement extends LitElement {
private seq = new HotkeySequenceController(this, ['G', 'G'], () => this.goToTop())
constructor() {
super()
this.addController(this.seq)
}
}new HotkeySequenceController(
_host,
_sequence,
_callback,
_options): HotkeySequenceController;new HotkeySequenceController(
_host,
_sequence,
_callback,
_options): HotkeySequenceController;Defined in: controllers/hotkey-sequence.ts:38
ReactiveControllerHost
The Lit component that owns this controller (use this and pass it to addController()).
HotkeySequence
The key sequence to listen for (e.g. ['G', 'G']).
HotkeyCallback
Function to run when the sequence is completed; called with the host as this.
SequenceOptions = HOTKEY_SEQUENCE_DEFAULT_OPTIONS
Optional sequence options (target, timeout, enabled, etc.).
HotkeySequenceController
hostConnected(): void;hostConnected(): void;Defined in: controllers/hotkey-sequence.ts:49
Registers the sequence with the global sequence manager when the host is connected to the DOM. Skips registration if disabled, sequence is empty, or no target is available.
void
ReactiveController.hostConnectedReactiveController.hostConnectedhostDisconnected(): void;hostDisconnected(): void;Defined in: controllers/hotkey-sequence.ts:76
Unregisters the sequence when the host is disconnected from the DOM.
void
ReactiveController.hostDisconnectedReactiveController.hostDisconnected