Skip to content

Function: matchesShortcut() ​

ts
function matchesShortcut(
   event, 
   shortcut, 
   apple?
): boolean;

Whether a keyboard event matches a ProseMirror-style shortcut such as Mod-k.

Parameters ​

ParameterType
event{ altKey?: boolean; ctrlKey?: boolean; key?: string; metaKey?: boolean; shiftKey?: boolean; }
event.altKey?boolean
event.ctrlKey?boolean
event.key?string
event.metaKey?boolean
event.shiftKey?boolean
shortcutstring
apple?boolean

Returns ​

boolean