function createHotkey<T>(
hotkey,
callback,
options?): void;Defined in: createHotkey.ts:66
Solid primitive for registering a hotkey: a chord such as 'Mod+S', a sequence such as ['G', 'G'], or an app hotkey from defineAppHotkeys. The hotkey and options may be accessors.
Chords accept requireReset; sequences accept timeout. A one-step sequence registers as its chord. An app hotkey uses its effective hotkey from HotkeysProvider (including the user's custom hotkey) and its declared meta and options, and registers nothing while unbound. undefined, null, or '' registers nothing, for an optional shortcut.
T extends AppHotkey<string, HotkeyChord | HotkeySequence | null>
MaybeAccessor<T | null | undefined>
HotkeyCallback
MaybeAccessor<CreateAppHotkeyOptions<T>>
void
createHotkey('Mod+S', () => save())
createHotkey(['G', 'G'], () => scrollToTop(), { timeout: 500 })
createHotkey('Escape', () => close(), () => ({ enabled: isOpen() }))function createHotkey<T>(
hotkey,
callback,
options?): void;Defined in: createHotkey.ts:71
Solid primitive for registering a hotkey: a chord such as 'Mod+S', a sequence such as ['G', 'G'], or an app hotkey from defineAppHotkeys. The hotkey and options may be accessors.
Chords accept requireReset; sequences accept timeout. A one-step sequence registers as its chord. An app hotkey uses its effective hotkey from HotkeysProvider (including the user's custom hotkey) and its declared meta and options, and registers nothing while unbound. undefined, null, or '' registers nothing, for an optional shortcut.
T extends RegisterableHotkey
MaybeAccessor<T | null | undefined>
HotkeyCallback<HotkeyCallbackContextFor<T>>
MaybeAccessor<AdapterOptionsFor<T, CreateHotkeyTarget>>
void
createHotkey('Mod+S', () => save())
createHotkey(['G', 'G'], () => scrollToTop(), { timeout: 500 })
createHotkey('Escape', () => close(), () => ({ enabled: isOpen() }))