Keyboard shortcuts allow you to execute a feature quickly, by pressing a combination of keys on your keyboard.
AITiny allows you to set up shortcuts for any prebuilt or custom action.
JCE is based on an older version of TinyMCE. It appears that shortcuts using some special keys –such as ENTER, or the F-row keys– do not work with JCE even though they do work with TinyMCE.
If you have users who will be using JCE on your site and you want them to access certain features using keyboard shortcuts you should use shortcuts which consist only of modifiers (CTRL, ALT, SHIFT etc) and printable character keys (letters A-Z, and numbers 0-9).
A shortcut expression usually consists of a number of modifier keys (such as Ctrl, Shift, Alt / Option) and a key joined together with the plus sign (+
). For example, Ctrl+Shift+A
means that the shortcut is activated when the user presses the Ctrl (Control), Shift, and A keys at the same time.
Special keys which do not correspond to a printable letter or symbol are represented by their numeric key code. For example, Ctrl+Shift+13
means that the shortcut is activated when the user presses the Ctrl (Control), Shift, and ENTER keys at the same time; 13 is the key code for the ENTER key.
The modifiers and key names are case insensitive. For example, the following work identically:
Ctrl+Shift+A
ctrl+shift+a
CTRL+SHIFT+A
Do not leave any spaces around the plus sign; TinyMCE does not officially support this format; it requires the plus signs to be snug against the modifiers and keycodes.
TinyMCE knows of the following modifiers:
Table4.1.Table of modifier keys known to TinyMCE
Modifier | Windows / Linux | macOS |
---|---|---|
Meta | CTRL | CMD |
Shift | SHIFT | SHIFT |
Ctrl | CTRL | CTRL |
Alt | ALT | OPT |
Access | SHIFT+ALT | CTRL+OPT |
Special keys are referred to by their keycode. You can find the keycodes of special keys at various online resources, such as Toptal.
You cannot use keycodes below 10, as they are understood to be numeric keys. In practice, this means you cannot use TAB or BACKSPACE in your shortcuts.
Do NOT use the keycodes for any modifier keys. This will have unexpected results which may render your editor unusable.
Your shortcuts will override any shortcut already defined by TinyMCE.
Support for keyboard shortcuts and key codes varies widely across Operating Systems, browsers, and their different versions. For example, macOS binds F13 to F19 to some of the special actions you see above the F1 – F12 keys on an Apple keyboard, and handles them directly, without passing them to the browser. Linux, on the other hand, understands F13 to F20 (and sometimes up to F24) without a problem.
Mobile devices with external keyboards attached typically allow for a fraction of the shortcuts and key codes supported by the equivalent desktop / laptop operating system. For example, iPadOS supports a fraction of the key codes that macOS does, even though they both have the same kernel. Likewise, Android supports a fraction of the key codes that Linux does, even though Android uses a (modified) Linux kernel.
Finally, try to bring a balance between ease of use and overcrowding your editor with shortcuts. Think about which features your editors are likely to use the most and assign shortcuts only to them. If AI integration is something that is going to be used sporadically you may want to disable shortcuts altogether.