useHotkey API
API reference for the useHotkey composable.
Functions
useHotkey
(keys: MaybeRefOrGetter<string>, callback: (e: KeyboardEvent) => void, options?: UseHotkeyOptions, _platform?: PlatformContext) => UseHotkeyReturnA composable that listens for hotkey combinations and sequences.
Options
inputs
MaybeRefOrGetter<boolean>Whether to trigger the callback when an input element is focused.
Default: false
Properties
isActive
Readonly<Ref<boolean, boolean>>Whether the hotkey listener is currently active (listening for keys). False when paused, when keys is undefined, or in SSR.
