Skip to content

HotkeyOptions

Defined in: src/core/hotkeys.ts:18

Options to register a hotkey (via useHotkey or HotkeyRegistry.register).

optional context?: string | readonly string[]

Defined in: src/core/hotkeys.ts:36

App context(s) this hotkey is active in. Omitted means global (active in every context). Matched against HotkeyRegistry.context.


optional description?: string

Defined in: src/core/hotkeys.ts:29

One-line explanation shown next to the name.


optional enabled?: () => boolean

Defined in: src/core/hotkeys.ts:38

Extra gate evaluated at dispatch and list time (e.g. “has selection”).

boolean


optional group?: string

Defined in: src/core/hotkeys.ts:31

Palette section, e.g. “File”, “Navigation”. Defaults to "General".


handler: (ev) => void

Defined in: src/core/hotkeys.ts:42

Called when the key is pressed.

KeyEvent

void


optional hidden?: boolean

Defined in: src/core/hotkeys.ts:40

Keep the hotkey functional but omit it from the palette listing.


key: string

Defined in: src/core/hotkeys.ts:25

Key spec, e.g. "ctrl+p", "ctrl+shift+s", "alt+enter", "f5", "?". Modifiers: ctrl, alt (terminal Meta/Alt), shift. Case and modifier order are normalized, so "Ctrl+Shift+P" and "shift+ctrl+p" are the same binding.


name: string

Defined in: src/core/hotkeys.ts:27

Short human name shown in the palette, e.g. “Save file”.