IHotkeyOptions

interface
Directives & Utilities

Configuration options for the useHotkey composable and the v-hotkey directive — controls the listened event type, whether inputs are excluded and sequence timing.

TypeScript

Definition

The TypeScript interface definition as found in the origam source. Click the copy icon to copy the snippet.

typescript

API

Properties

Every property declared by this interface, with its type, optionality and default.

event
MaybeRef<'keydown' | 'keyup'>
Keyboard event to listen on — 'keydown' (default) or 'keyup'.
inputs
MaybeRef<boolean>
When true, the hotkey fires even when focus is inside an input, textarea or select element. Defaults to false.
preventDefault
MaybeRef<boolean>
When true, calls event.preventDefault() before invoking the handler. Defaults to false.
sequenceTimeout
MaybeRef<number>
Milliseconds allowed between successive keys in a sequence binding before the sequence resets. Defaults to 1000.

Ecosystem

Used by

Components and composables that extend or consume this interface.

Usage

Examples

Ready-to-paste code snippets using this interface.

Passing options to useHotkey

typescript