<!-- saved from url=(0026)http://www.naturaldocs.org -->
<divid=Content><divclass="CClass"><divclass=CTopicid=MainTopic><h1class=CTitle><aname="mxDefaultKeyHandlerCodec"></a>mxDefaultKeyHandlerCodec</h1><divclass=CBody><p>Custom codec for configuring <ahref="../editor/mxDefaultKeyHandler-js.html#mxDefaultKeyHandler"class=LClassid=link4onMouseOver="ShowTip(event, 'tt1', 'link4')"onMouseOut="HideTip('tt1')">mxDefaultKeyHandler</a>s. This class is created and registered dynamically at load time and used implicitely via <ahref="mxCodec-js.html#mxCodec"class=LClassid=link5onMouseOver="ShowTip(event, 'tt4', 'link5')"onMouseOut="HideTip('tt4')">mxCodec</a> and the <ahref="mxCodecRegistry-js.html#mxCodecRegistry"class=LClassid=link6onMouseOver="ShowTip(event, 'tt5', 'link6')"onMouseOut="HideTip('tt5')">mxCodecRegistry</a>. This codec only reads configuration data for existing key handlers, it does not encode or create key handlers.</p><!--START_ND_SUMMARY--><divclass=Summary><divclass=STitle>Summary</div><divclass=SBorder><tableborder=0cellspacing=0cellpadding=0class=STable><trclass="SMain"><tdclass=SEntry><ahref="#mxDefaultKeyHandlerCodec">mxDefaultKeyHandlerCodec</a></td><tdclass=SDescription>Custom codec for configuring <ahref="../editor/mxDefaultKeyHandler-js.html#mxDefaultKeyHandler"class=LClassid=link1onMouseOver="ShowTip(event, 'tt1', 'link1')"onMouseOut="HideTip('tt1')">mxDefaultKeyHandler</a>s. </td></tr><trclass="SGroup SIndent1"><tdclass=SEntry><ahref="#mxDefaultKeyHandlerCodec.Functions">Functions</a></td><tdclass=SDescription></td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#mxDefaultKeyHandlerCodec.encode"id=link2onMouseOver="ShowTip(event, 'tt2', 'link2')"onMouseOut="HideTip('tt2')">encode</a></td><tdclass=SDescription>Returns null.</td></tr><trclass="SFunction SIndent2"><tdclass=SEntry><ahref="#mxDefaultKeyHandlerCodec.decode"id=link3onMouseOver="ShowTip(event, 'tt3', 'link3')"onMouseOut="HideTip('tt3')">decode</a></td><tdclass=SDescription>Reads a sequence of the following child nodes and attributes:</td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxDefaultKeyHandlerCodec.decode"></a>decode</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>codec.decode = function(</td><tdclass=PParameternowrap>dec,</td></tr><tr><td></td><tdclass=PParameternowrap>node,</td></tr><tr><td></td><tdclass=PParameternowrap>into</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Reads a sequence of the following child nodes and attributes:</p><h4class=CHeading>Child Nodes</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>add</td><tdclass=CDLDescription>Binds a keystroke to an actionname.</td></tr></table><h4class=CHeading>Attributes</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>as</td><tdclass=CDLDescription>Keycode.</td></tr><tr><tdclass=CDLEntry>action</td><tdclass=CDLDescription>Actionname to execute in editor.</td></tr><tr><tdclass=CDLEntry>control</td><tdclass=CDLDescription>Optional boolean indicating if the control key must be pressed.</td></tr></table><h4class=CHeading>Example</h4><blockquote><preclass="prettyprint"><mxDefaultKeyHandler as="keyHandler">
</mxDefaultKeyHandler></pre></blockquote><p>The keycodes are for the x, c and v keys.</p><p>See also: <ahref="../editor/mxDefaultKeyHandler-js.html#mxDefaultKeyHandler.bindAction"class=LFunctionid=link7onMouseOver="ShowTip(event, 'tt6', 'link7')"onMouseOut="HideTip('tt6')">mxDefaultKeyHandler.bindAction</a>, <ahref="http://www.js-examples.com/page/tutorials__key_codes.html"class=LURLtarget=_top>http://www.js-examples.com<wbr>/page<wbr>/tutorials__key_codes.html</a></p></div></div></div>
</div><!--Content-->
<divid=Footer><ahref="http://www.naturaldocs.org">Generated by Natural Docs</a></div><!--Footer-->
<divclass=CToolTipid="tt1"><divclass=CClass>Binds keycodes to actionnames in an editor. </div></div><divclass=CToolTipid="tt2"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>codec.encode = function(</td><tdclass=PParameternowrap>enc,</td></tr><tr><td></td><tdclass=PParameternowrap>obj</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Returns null.</div></div><divclass=CToolTipid="tt3"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>codec.decode = function(</td><tdclass=PParameternowrap>dec,</td></tr><tr><td></td><tdclass=PParameternowrap>node,</td></tr><tr><td></td><tdclass=PParameternowrap>into</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Reads a sequence of the following child nodes and attributes:</div></div><divclass=CToolTipid="tt4"><divclass=CClass>XML codec for JavaScript object graphs. </div></div><divclass=CToolTipid="tt5"><divclass=CClass>Singleton class that acts as a global registry for codecs.</div></div><divclass=CToolTipid="tt6"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>mxDefaultKeyHandler.prototype.bindAction = function (</td><tdclass=PParameternowrap>code,</td></tr><tr><td></td><tdclass=PParameternowrap>action,</td></tr><tr><td></td><tdclass=PParameternowrap>control</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Binds the specified keycode to the given action in editor. </div></div><!--END_ND_TOOLTIPS-->