JavaScript/jQuery Diagram - Keyboard Support

A user can press the following keys to interact with the UI component:

KeyAction
Ctrl + X / Shift + DeleteCuts the selected elements.
Ctrl + C / Ctrl + InsertCopies the selected elements to the clipboard.
Ctrl + V / Shift + InsertPastes the contents of the clipboard.
Ctrl + ASelects all elements on the diagram page.
Delete / BackspaceDeletes the selected elements.
Ctrl + ZUndoes the last action.
Ctrl + YRedoes the last undone action.
Ctrl + BApplies bold formatting to the text of the selected elements.
Ctrl + IApplies italic formatting to the text of the selected elements.
Ctrl + UUnderlines the text of the selected elements.
Ctrl + EnterFinishes shape/connector text editing.
Arrow KeysMoves the selected elements one grid cell in the specified direction.
Moves focus between toolbar items (left and right arrow keys only).
Ctrl + Arrow KeysMoves the selected elements one pixel in the specified direction.
Alt + Arrow KeysClones the selected elements.
Home
End
Moves focus to the first/last item in a toolbar.
Left Mouse Button DragMoves the selected elements. If you release the mouse button above a container, places the elements inside this container.
Ctrl + Left Mouse Button DragMoves the selected elements. If you release the mouse button above a container, places the elements outside this container.
Shift + Left Mouse Button DragMoves the selected elements horizontally or vertically. If you release the mouse button above a container, places the elements outside this container.
Ctrl + Mouse WheelZooms into or out of a diagram page.
Space + Left Mouse ButtonPans a diagram page if the Diagram UI component is focused.
F11Switches to full screen.

To navigate between toolbar items using the Tab key, disable allowKeyboardNavigation in Diagram Toolbar instances. Call dxToolbar.defaultOptions() as follows:

index.js
  • DevExpress.ui.dxToolbar.defaultOptions({
  • options: {
  • onInitialized(e) {
  • if ($(e.element).closest('.dx-diagram').length) {
  • e.component.option('allowKeyboardNavigation', false);
  • }
  • }
  • }
  • })

Replace .dx-diagram with a component ID or class to modify keyboard navigation behavior in a specific component only.

IMPORTANT
If you disable allowKeyboardNavigation, the DevExtreme Toolbar no longer follows the W3C ARIA APG Toolbar Pattern. Your application will be less accessible to users who rely on keyboard navigation.

Refer to the following section for more information: Work with Chart Elements.