Skip to content

ckeditor5-elements / keyboardPriorities

Variable: keyboardPriorities ​

ts
const keyboardPriorities: object;

The priorities of the keyboard listeners of the element features, on the events of the view document (keydown, insertText, enter). They are in one place, as their order matters where several features handle the same key: a listener with a higher priority goes first, and stops the event when it handles it.

In their order, from the first:

  1. twoStepCaretMovement: the arrow keys at the ends of an inline element with text.
  2. verbatimEnter: Enter in a verbatim block.
  3. selectable, listEnter, typing: the arrow keys that select an element, Enter in a list item, and the text typed at the cursor. They handle different events, so they do not meet.
  4. CKEditor's own listeners, e.g. its Enter and its widgets, with the normal priority.
  5. selectableEsc: Esc, which selects the element around the cursor.

Type Declaration ​

listEnter ​

ts
readonly listEnter: "high" = 'high';

Enter in a list item, which makes the next item: before CKEditor's Enter, which would split the block in the item.

selectable ​

ts
readonly selectable: "high" = 'high';

The arrow keys of ElementSelectable, on keydown: before CKEditor's widgets, which handle the arrow keys of every object (as the arrowKey event).

selectableEsc ​

ts
readonly selectableEsc: "low" = 'low';

Esc, which selects the element around the cursor: after what else uses it, e.g. closing a balloon.

twoStepCaretMovement ​

ts
readonly twoStepCaretMovement: "highest" = 'highest';

The arrow keys of two-step caret movement, before anything else that moves the cursor: e.g. ElementSelectable selects an inline object that the cursor reaches, and it may be just after the end of an inline element.

typing ​

ts
readonly typing: "high" = 'high';

The text typed at the cursor at an end of an inline element (insertText): before CKEditor's typing, which would type it where the browser puts it.

verbatimEnter ​

ts
readonly verbatimEnter: number;

Enter in a verbatim block, which inserts a new line: before Enter in a list item, as a verbatim block can be in an item, and before CKEditor's Enter, which would split the block.