tinymce.Shortcuts
Contains logic for handling keyboard shortcuts.
Examples
editor.shortcuts.add('ctrl+a', 'description of the shortcut', () => {});
editor.shortcuts.add('ctrl+alt+a', 'description of the shortcut', () => {});
// "meta" maps to Command on Mac and Ctrl on PC
editor.shortcuts.add('meta+a', 'description of the shortcut', () => {});
// "access" maps to Control+Option on Mac and shift+alt on PC
editor.shortcuts.add('access+a', 'description of the shortcut', () => {});
editor.shortcuts.add('meta+access+c', 'Opens the code editor dialog.', () => {
editor.execCommand('mceCodeEditor');
});
editor.shortcuts.add('meta+shift+32', 'Inserts "Hello, World!" for meta+shift+space', () => {
editor.execCommand('mceInsertContent', false, 'Hello, World!');
});
Methods
add()
add(pattern: String, desc: String, cmdFunc: String | Function, scope: Object): Boolean
Adds a keyboard shortcut for some command or function.