Shortcuts or hotkeys are combination of computer keyboard keys that allow users to perform actions and operations quickly without having to use the mouse or touchpad.
You can add the shortcut ability to your editor with the help of
To have shortcut enabled in your editor you have to provide to functions. The first one
helps editor to bind the key combinations and the second one will translate that combination
to a meaningful editor action.
NOTE: The default value provided as shortcut map for the following utilities only supports
SOFT_NEWLINE. If you need a complete shortcut support
shortcutMap to as the
customShortcuts. There is a default list of key combination
contenido and you can check it here.
getDefaultKeyBindingFn utility helps you to bind key combinations.
shortcutHandler utility will handle the action returned by
updates the editor state.
An example of shortcuts usage:
You can create a custom shortcut map of
ShortcutMap type and then pass it as a new shortcut
to the default one.
BOLD style shortcut object as an example:
command, 'shift', 'alt' and 'option' keywords are meaningful
for the handler. You can also write your own function as shortcut handler.
Here is an example of shortcuts customization: