Skip to content

Interface: Keybinding

Defined in: packages/sdk/src/types.ts:233

Binds a keyboard shortcut to a Command.

Properties

id

ts
id: string;

Defined in: packages/sdk/src/types.ts:235

Unique id for this binding.


key

ts
key: string;

Defined in: packages/sdk/src/types.ts:241

Shortcut spec like "cmd+s", "ctrl+shift+s", "cmd+1", "cmd+shift+=". Parsed against KeyboardEvent.code for layout-stable letter/digit keys plus a small alias table for symbol keys (= → Equal, - → Minus, etc.).


command

ts
command: string;

Defined in: packages/sdk/src/types.ts:243

Id of the Command to invoke.


when?

ts
optional when?: (ctx) => boolean;

Defined in: packages/sdk/src/types.ts:245

Optional predicate against context keys; the binding is inert when false.

Parameters

ctx

ContextKeys

Returns

boolean