function useHotkey<T>(
hotkey,
callback,
options?): void;Defined in: useHotkey.ts:76
Vue composable 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 refs or getters.
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.
T extends AppHotkey<string, HotkeyChord | HotkeySequence | null>
MaybeRefOrGetter<T>
HotkeyCallback
MaybeRefOrGetter<UseAppHotkeyOptions<T>>
void
useHotkey('Mod+S', () => save())
useHotkey(['G', 'G'], () => scrollToTop(), { timeout: 500 })
useHotkey('Escape', () => close(), { enabled: isOpen })function useHotkey<T>(
hotkey,
callback,
options?): void;Defined in: useHotkey.ts:81
Vue composable 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 refs or getters.
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.
T extends RegisterableHotkey
MaybeRefOrGetter<T>
HotkeyCallback<HotkeyCallbackContextFor<T>>
MaybeRefOrGetter<UseHotkeyOptionsFor<T>>
void
useHotkey('Mod+S', () => save())
useHotkey(['G', 'G'], () => scrollToTop(), { timeout: 500 })
useHotkey('Escape', () => close(), { enabled: isOpen })