EditingKeystrokeHandler (core)
@ckeditor/ckeditor5-core/src/editingkeystrokehandler
A keystroke handler for editor editing. Its instance is available
in keystrokes
so plugins
can register their keystrokes.
E.g. an undo plugin would do this:
editor.keystrokes.set( 'Ctrl+Z', 'undo' );
editor.keystrokes.set( 'Ctrl+Shift+Z', 'redo' );
editor.keystrokes.set( 'Ctrl+Y', 'redo' );
Filtering
Properties
-
The editor instance.
-
protected inherited
_listener : Emitter
module:core/editingkeystrokehandler~EditingKeystrokeHandler#_listener
Listener used to listen to events for easier keystroke handler destruction.
Methods
-
constructor( editor )
module:core/editingkeystrokehandler~EditingKeystrokeHandler#constructor
-
Destroys the keystroke handler.
-
-
inherited
press( keyEvtData ) → Boolean
module:core/editingkeystrokehandler~EditingKeystrokeHandler#press
Triggers a keystroke handler for a specified key combination, if such a keystroke was defined.
Parameters
keyEvtData : KeyEventData
Key event data.
Returns
Boolean
Whether the keystroke was handled.
-
inherited
set( keystroke, callback, [ options ] = { [options.priority] } )
module:core/editingkeystrokehandler~EditingKeystrokeHandler#set
Registers a handler for the specified keystroke.
Parameters
keystroke : String | Array.<(String | Number)>
Keystroke defined in a format accepted by the
parseKeystroke
function.callback : function
A function called with the key event data object and a helper funcion to call both
preventDefault()
andstopPropagation()
on the underlying event.[ options ] : Object
Additional options.
Properties[ options.priority ] : PriorityString | Number
The priority of the keystroke callback. The higher the priority value the sooner the callback will be executed. Keystrokes having the same priority are called in the order they were added.
Defaults to
'normal'
Defaults to
{}
Every day, we work hard to keep our documentation complete. Have you spotted outdated information? Is something missing? Please report it via our issue tracker.