function createHotkeySequences(sequences, commonOptions): void;
Defined in: createHotkeySequences.ts:61
SolidJS primitive for registering multiple keyboard shortcut sequences at once (Vim-style).
Uses the singleton SequenceManager. Accepts a dynamic array of definitions, or accessors, so you can react to variable-length lists.
Options are merged in this order: HotkeysProvider defaults < commonOptions < per-definition options
Definitions with an empty sequence are skipped (no registration).
Array of sequence definitions, or accessor returning them
CreateHotkeySequenceDefinition[] | () => CreateHotkeySequenceDefinition[]
Shared options for all sequences, or accessor
CreateHotkeySequenceOptions | () => CreateHotkeySequenceOptions
void
function VimPalette() {
createHotkeySequences([
{ sequence: ['G', 'G'], callback: () => scrollToTop() },
{ sequence: ['D', 'D'], callback: () => deleteLine() },
])
}
function Dynamic(props) {
createHotkeySequences(
() => props.items.map((item) => ({
sequence: item.chords,
callback: item.action,
options: { enabled: item.enabled },
})),
{ preventDefault: true },
)
}