Days
Hours
Minutes
Seconds
x

New Froala Editor v5.0.0 is here โ€“ Learn More

Skip to content

Custom Elements

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);

Ready to dive in ? Explore our plans

Sign up

Download the code by signing up for our newsletter

Sign up

Download the code by signing up for our newsletter

Note: By registering, you confirm that you agree to the processing of your personal data by Froala, Inc. - Froala as described in the Privacy Statement. Froala, Inc. - Froala is part of the Idera group and may share your information with its parent company Idera, Inc., and its affiliates. For further details on how your data is used, stored, and shared, please review our Privacy Statement.