SCEditor

addShortcut()

addShortcut(shortcut, handler) Since: 1.4.3

Adds a shortcut handler to the editor. If a handler for the specified shortcut already exists, it will be replaced.

The shortcut shoult be a string of keys separated by plus (+) signs and the modifier keys should be ordered ctrl, alt and then shift.

e.g.:

ctrl+alt+s
alt+shift+a
ctrl+shift+b
alt+b

Info: The shortcut is bound to both WYSIWYG and source modes. It’s up to the shortcut handler to check which mode the editor is in and take appropriate action.

Syntax

instance.addShortcut(shortcut, handler);

Parameters

shortcut Type: String

The shortcut string to match.

handler Type Function or String

The function to be called when the shortcut is pressed or a string. If this is a string the editor will call the command with the same name as the string value.

Return

Type: sceditor