HotkeyOptions
Defined in: src/core/hotkeys.ts:18
Options to register a hotkey (via useHotkey or HotkeyRegistry.register).
Extended by
Section titled “Extended by”Properties
Section titled “Properties”context?
Section titled “context?”
optionalcontext?:string| readonlystring[]
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.
description?
Section titled “description?”
optionaldescription?:string
Defined in: src/core/hotkeys.ts:29
One-line explanation shown next to the name.
enabled?
Section titled “enabled?”
optionalenabled?: () =>boolean
Defined in: src/core/hotkeys.ts:38
Extra gate evaluated at dispatch and list time (e.g. “has selection”).
Returns
Section titled “Returns”boolean
group?
Section titled “group?”
optionalgroup?:string
Defined in: src/core/hotkeys.ts:31
Palette section, e.g. “File”, “Navigation”. Defaults to "General".
handler
Section titled “handler”handler: (
ev) =>void
Defined in: src/core/hotkeys.ts:42
Called when the key is pressed.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
hidden?
Section titled “hidden?”
optionalhidden?: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”.