Skip to main content

Function: useCanvasHotkey()

useCanvasHotkey(hotkey, action): undefined | CanvasHotkey

Defined in: diagram/canvasWidget.tsx:72

Registers an active hotkey while the caller component is mounted on the canvas.

If either hotkey or action is undefined or null, the hotkey will be inactive.

Parameters

ParameterType

hotkey

undefined | null | `Alt+${Capitalize<string>}` | `Meta+${Capitalize<string>}` | `Shift+${Capitalize<string>}` | `None+${Capitalize<string>}` | `Mod+${Capitalize<string>}` | `Ctrl+${Capitalize<string>}`

action

undefined | () => void

Returns

undefined | CanvasHotkey