useHotkey
useHotkey(
opts):void
Defined in: react/components/overlay/hotkey-palette.tsx:33
Register a hotkey for the lifetime of the component. The handler is read through a ref, so it can close over fresh state without re-registering.
useHotkey({ key: "ctrl+s", name: "Save", group: "File", handler: save });Parameters
Section titled “Parameters”HotkeyOptions
Returns
Section titled “Returns”void