function createMultiHotkeyHandler(handlers, options): (event) => void;
Defined in: match.ts:173
Creates a handler that matches multiple hotkeys.
MultiHotkeyHandler
A map of hotkey strings to their handlers
CreateHotkeyHandlerOptions = {}
Options for matching and handling
A function that can be used as an event handler
(event): void;
KeyboardEvent
void
const handler = createMultiHotkeyHandler({
'Mod+S': (event, { hotkey }) => handleSave(),
'Mod+Z': (event, { hotkey }) => handleUndo(),
'Mod+Shift+Z': (event, { hotkey }) => handleRedo(),
})
document.addEventListener('keydown', handler)