Skip to main content

Function: useCanvasHotkey()

useCanvasHotkey(hotkey, action): undefined | CanvasHotkey

Defined in: src/diagram/canvasHotkey.tsx:27

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 | `Mod+${Capitalize<string>}` | `Ctrl+${Capitalize<string>}` | `Meta+${Capitalize<string>}` | `Alt+${Capitalize<string>}` | `Shift+${Capitalize<string>}` | `None+${Capitalize<string>}`

action

undefined | () => void

Returns​

undefined | CanvasHotkey