It looks like you’re browsing an old version of Froala. Please go to the newer version of our docs for a more updated version.
- Documentation
- Concepts
- Custom Elements
- Save
- File
- Image
- Video
- Embedly Plugin
- Migration Guides
- From TinyMCE
- From V1
Custom Elements
Custom Button
Custom Plugin
Custom Dropdown
Custom Icon
Custom Popup
Custom Quick Insert Button
Custom Shortcut
Custom Shortcut
Below is the basic JS for registering a custom shortcut for the editor. Once registered, the shortcut can be disabled through the shortcutsEnabled option.
// $.FroalaEditor.RegisterShortcut(key_code, cmd, val, letter, shift_key, option_key); // key_code : key code of the key pressed // cmd : command that should be triggered // val : value passed to the command (optional) // letter : the letter to be shown in the tooltip for shortcut (optional) // shift_key : shortcut needs to have the SHIFT key pressed (optional) // option_key: shortcut needs to have the OPTION key pressed (optional) $.FroalaEditor.RegisterShortcut(49, 'paragraphFormat', 'H1', 'H', false);