KeyboardCommand.onKey method
KeyboardCommand › onKey
The handler invoked when the shortcut is pressed. When omitted, the command is a hint only and no scope handler is registered.Signature:
onKey(evt: KeyboardEvent, ctx: KeymapContext): booleanParameters:
| Parameter | Type | Description |
|---|---|---|
| evt | KeyboardEvent | The keyboard event. |
| ctx | KeymapContext | The keymap context. |
Returns: boolean — false to prevent Obsidian's default handling, or void/true otherwise.