function injectHotkeySequence(
sequence,
callback,
options): void;
Defined in: injectHotkeySequence.ts:42
Angular inject-based API for registering a keyboard shortcut sequence (Vim-style).
Allows you to register multi-key sequences like 'g g' or 'd d' that trigger when the full sequence is pressed within a timeout.
Array of hotkey strings that form the sequence (or getter function)
HotkeySequence | () => HotkeySequence
HotkeyCallback
Function to call when the sequence is completed
Options for the sequence behavior (or getter function)
InjectHotkeySequenceOptions | () => InjectHotkeySequenceOptions
void
@Component({ ... })
export class VimEditorComponent {
lastSequence = signal<string | null>(null)
constructor() {
injectHotkeySequence(['G', 'G'], () => this.lastSequence.set('gg → Go to top'))
injectHotkeySequence(['D', 'D'], () => this.lastSequence.set('dd → Delete line'))
injectHotkeySequence(['C', 'I', 'W'], () => this.lastSequence.set('ciw'), { timeout: 500 })
}
}