本页还没有译文
本页 16 段还没译成日本語,下面显示的是英文原文。createHotkeySequences
还没翻译译自英文(tanstack.com)本页 16 段都还没译
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).
Parameters
sequences
| CreateHotkeySequenceDefinition[]
| (() => CreateHotkeySequenceDefinition[])
Array of sequence definitions, or accessor returning them
commonOptions?
| CreateHotkeySequenceOptions
| (() => CreateHotkeySequenceOptions)
Shared options for all sequences, or accessor
Returns
void
Examples
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 },
)
}AI 翻译查看英文原文