Defined in: controllers/hotkey-sequence-recorder.ts:45
A Lit ReactiveController that records multi-chord sequences (Vim-style shortcuts).
Wraps the framework-agnostic HotkeySequenceRecorder class, managing store subscriptions and host update lifecycle automatically.
class ShortcutSettings extends LitElement {
private recorder = new HotkeySequenceRecorderController(this, {
onRecord: (sequence) => {
this.sequence = sequence
this.requestUpdate()
},
onCancel: () => {
console.log('Recording cancelled')
},
})
private sequence: HotkeySequence | null = null
render() {
return html`
<button @click=${() => this.recorder.startRecording()}>
${this.recorder.isRecording ? 'Recording...' : 'Edit Sequence'}
</button>
${this.recorder.steps.length
? html`<div>Steps: ${this.recorder.steps.join(' → ')}</div>`
: nothing}
${this.recorder.recordedSequence
? html`<div>Recorded: ${this.recorder.recordedSequence.join(' → ')}</div>`
: nothing}
`
}
}class ShortcutSettings extends LitElement {
private recorder = new HotkeySequenceRecorderController(this, {
onRecord: (sequence) => {
this.sequence = sequence
this.requestUpdate()
},
onCancel: () => {
console.log('Recording cancelled')
},
})
private sequence: HotkeySequence | null = null
render() {
return html`
<button @click=${() => this.recorder.startRecording()}>
${this.recorder.isRecording ? 'Recording...' : 'Edit Sequence'}
</button>
${this.recorder.steps.length
? html`<div>Steps: ${this.recorder.steps.join(' → ')}</div>`
: nothing}
${this.recorder.recordedSequence
? html`<div>Recorded: ${this.recorder.recordedSequence.join(' → ')}</div>`
: nothing}
`
}
}new HotkeySequenceRecorderController(_host, _options): HotkeySequenceRecorderController;new HotkeySequenceRecorderController(_host, _options): HotkeySequenceRecorderController;Defined in: controllers/hotkey-sequence-recorder.ts:76
ReactiveControllerHost
The Lit component that owns this controller.
HotkeySequenceRecorderOptions
Configuration options for the sequence recorder.
HotkeySequenceRecorderController
get isRecording(): boolean;get isRecording(): boolean;Defined in: controllers/hotkey-sequence-recorder.ts:58
Whether recording is currently active.
boolean
get recordedSequence(): HotkeySequence | null;get recordedSequence(): HotkeySequence | null;Defined in: controllers/hotkey-sequence-recorder.ts:68
Last committed sequence, or null if none.
HotkeySequence | null
get steps(): HotkeySequence;get steps(): HotkeySequence;Defined in: controllers/hotkey-sequence-recorder.ts:63
Chords captured in the current session.
HotkeySequence
cancelRecording(): void;cancelRecording(): void;Defined in: controllers/hotkey-sequence-recorder.ts:133
Cancel recording without saving.
void
commitRecording(): void;commitRecording(): void;Defined in: controllers/hotkey-sequence-recorder.ts:138
Commit current steps as a sequence (no-op if empty).
void
hostConnected(): void;hostConnected(): void;Defined in: controllers/hotkey-sequence-recorder.ts:85
Subscribes to the recorder store and updates internal state when changes occur.
void
ReactiveController.hostConnectedReactiveController.hostConnectedhostDisconnected(): void;hostDisconnected(): void;Defined in: controllers/hotkey-sequence-recorder.ts:107
Unsubscribes from the recorder store and destroys the recorder instance to prevent memory leaks.
void
ReactiveController.hostDisconnectedReactiveController.hostDisconnectedsetOptions(options): void;setOptions(options): void;Defined in: controllers/hotkey-sequence-recorder.ts:117
Updates the recorder options.
Partial<HotkeySequenceRecorderOptions>
void
startRecording(): void;startRecording(): void;Defined in: controllers/hotkey-sequence-recorder.ts:123
Start recording a new sequence.
void
stopRecording(): void;stopRecording(): void;Defined in: controllers/hotkey-sequence-recorder.ts:128
Stop recording (same as cancel but without calling onCancel).
void