KeyboardCommand
A keyboard command shown in a SuggestModal’s instruction bar and optionally bound to a modifier+key handler.
Import:
import type { KeyboardCommand } from 'obsidian-dev-utils/obsidian/modals/suggest-modal-command-builder';Signature:
export interface KeyboardCommandProperties
| Property | Type | Description |
|---|---|---|
| key | string | The key shown in the instruction bar (and registered with the modal scope when KeyboardCommand.onKey is provided). |
| modifiers? | Modifier[] | The modifiers combined with KeyboardCommand.key. When omitted, no modifiers are required. |
| purpose | string | The human-readable description shown next to the key in the instruction bar. |
Methods
| Method | Returns | Description |
|---|---|---|
| onKey(evt, ctx) | boolean | The handler invoked when the shortcut is pressed. When omitted, the command is a hint only and no scope handler is registered. |