Creates an instance of the keystroke handler.
Destroys the keystroke handler.
Starts listening for keydown events from a given emitter.
Triggers a keystroke handler for a specified key combination, if such a keystroke was #set defined.
Key event data.
Whether the keystroke was handled.
Registers a handler for the specified keystroke.
Keystroke defined in a format accepted by the module:utils/keyboard~parseKeystroke function.
A function called with the
module:engine/view/observer/keyobserver~ViewDocumentKeyEventData key event data object and
a helper function to call both preventDefault() and stopPropagation() on the underlying event.
Optionaloptions: KeystrokeHandlerOptionsAdditional options.
Stops listening to keydown events from the given emitter.
Optionalemitter: HTMLElement | Emitter | Window
Keystroke handler allows registering callbacks for given keystrokes.
The most frequent use of this class is through the module:core/editor/editor~Editor#keystrokes
editor.keystrokesproperty. It allows listening to keystrokes executed in the editing view:However, this utility class can be used in various part of the UI. For instance, a certain module:ui/view~View can use it like this:
That keystroke handler will listen to
keydownevents fired in this view's main element.