Skip to content

UseHotkeyOptions

Defined in: src/hooks/useHotkey/useHotkey.types.ts:5

Properties

enabled?

optional enabled: boolean

Defined in: src/hooks/useHotkey/useHotkey.types.ts:10

When false, the binding is not active.

Default

true

enableInInputs?

optional enableInInputs: boolean

Defined in: src/hooks/useHotkey/useHotkey.types.ts:16

Whether to fire when focus is inside an editable element (<input>, <textarea>, [contenteditable]).

Default

false

preventDefault?

optional preventDefault: boolean

Defined in: src/hooks/useHotkey/useHotkey.types.ts:21

Call event.preventDefault() before invoking the handler.

Default

true

stopPropagation?

optional stopPropagation: boolean

Defined in: src/hooks/useHotkey/useHotkey.types.ts:26

Call event.stopPropagation() after the handler runs.

Default

false

target?

optional target: HotkeyTarget

Defined in: src/hooks/useHotkey/useHotkey.types.ts:34

Override the target element. Accepts either an EventTarget directly (e.g. document, an HTMLElement) or a RefObject whose .current resolves to one. The latter form re-attaches the listener once the ref mounts, so passing ref directly works without waiting a render. Defaults to window.