本页还没有译文
本页 16 段还没译成Tiếng Việt,下面显示的是英文原文。injectHotkeySequences
还没翻译译自英文(tanstack.com)本页 16 段都还没译
function injectHotkeySequences(sequences, commonOptions?): void;Defined in: injectHotkeySequences.ts:51
Angular inject-based API for registering multiple keyboard shortcut sequences at once (Vim-style).
Uses the singleton SequenceManager. Call in an injection context (e.g. constructor).
Uses effect() to track reactive dependencies when definitions or options are getters.
Options are merged in this order: provideHotkeys defaults < commonOptions < per-definition options
Definitions with an empty sequence are skipped. Disabled sequences (enabled: false)
remain registered so they stay visible in devtools; the core manager suppresses execution.
Parameters
sequences
| InjectHotkeySequenceDefinition[]
| (() => InjectHotkeySequenceDefinition[])
Array of sequence definitions, or getter returning them
commonOptions?
| InjectHotkeySequenceOptions
| (() => InjectHotkeySequenceOptions)
Shared options for all sequences, or getter
Returns
void
Example
@Component({ ... })
export class VimComponent {
constructor() {
injectHotkeySequences([
{ sequence: ['G', 'G'], callback: () => this.goTop() },
{ sequence: ['D', 'D'], callback: () => this.deleteLine() },
])
}
}