Options
All
  • Public
  • Public/Protected
  • All
Menu

Binds keycodes to actionnames in an editor. This aggregates an internal handler and extends the implementation of mxKeyHandler.escape to not only cancel the editing, but also hide the properties dialog and fire an <mxEditor.escape> event via editor. An instance of this class is created by mxEditor and stored in mxEditor.keyHandler.

example

Bind the delete key to the delete action in an existing editor.

var keyHandler = new mxDefaultKeyHandler(editor);
keyHandler.bindAction(46, 'delete');
codec

This class uses the {@link mxDefaultKeyHandlerCodec} to read configuration data into an existing instance. See {@link mxDefaultKeyHandlerCodec} for a description of the configuration format.

keycodes

See mxKeyHandler. An mxEvent.ESCAPE event is fired via the editor if the escape key is pressed.

Hierarchy

  • mxDefaultKeyHandler

Indexable

[key: string]: any

Binds keycodes to actionnames in an editor. This aggregates an internal handler and extends the implementation of mxKeyHandler.escape to not only cancel the editing, but also hide the properties dialog and fire an <mxEditor.escape> event via editor. An instance of this class is created by mxEditor and stored in mxEditor.keyHandler.

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

editor

editor: mxEditor

Reference to the enclosing mxEditor.

handler

handler: mxKeyHandler

Holds the mxKeyHandler for key event handling.

Methods

bindAction

  • bindAction(code: number, action: string, control?: boolean): void
  • Binds the specified keycode to the given action in editor. The optional control flag specifies if the control key must be pressed to trigger the action.

    Parameters

    • code: number

      Integer that specifies the keycode.

    • action: string

      Name of the action to execute in editor.

    • Optional control: boolean

      Optional boolean that specifies if control must be pressed. Default is false.

    Returns void

destroy

  • destroy(): void

Generated using TypeDoc