Custom codec for configuring mxDefaultKeyHandlers. This class is created and registered dynamically at load time and used implicitly via mxCodec and the mxCodecRegistry. This codec only reads configuration data for existing key handlers, it does not encode or create key handlers.
mxDefaultKeyHandlerCodec | Custom codec for configuring mxDefaultKeyHandlers. |
Functions | |
encode | Returns null. |
decode | Reads a sequence of the following child nodes and attributes: |
codec.decode = function( dec, node, into )
Reads a sequence of the following child nodes and attributes:
add | Binds a keystroke to an actionname. |
as | Keycode. |
action | Actionname to execute in editor. |
control | Optional boolean indicating if the control key must be pressed. |
<mxDefaultKeyHandler as="keyHandler"> <add as="88" control="true" action="cut"/> <add as="67" control="true" action="copy"/> <add as="86" control="true" action="paste"/> </mxDefaultKeyHandler>
The keycodes are for the x, c and v keys.
See also: mxDefaultKeyHandler.bindAction, http://www.js-examples.com
Returns null.
codec.encode = function( enc, obj )
Reads a sequence of the following child nodes and attributes:
codec.decode = function( dec, node, into )
Binds the specified keycode to the given action in editor.
mxDefaultKeyHandler.prototype.bindAction = function ( code, action, control )