+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-
- <head>
- <meta http-equiv="content-type" content="text/html; charset=undefined" />
- <meta name="generator" content="JsDoc Toolkit" />
-
-
- <title>JsDoc Reference - Roo.KeyMap</title>
-
-
- <link rel="stylesheet" type="text/css" href="../../css/roojs.css" />
- <link rel="stylesheet" type="text/css" href="../default.css" />
-
-
- <script type="text/javascript" src="../page.js">
-
- </script>
-
-
- </head>
-
- <body onload="RooDocsPage.onload();">
-
-
-<div class="body-wrap">
-
- <!-- ============================== links to methods. ================================= -->
-
- <div class="top-tools">
- <!--
- <a class="inner-link" href="#Roo.KeyMap-props"><img src="resources/s.gif" class="item-icon icon-prop">Properties</a>
- <a class="inner-link" href="#Roo.KeyMap-methods"><img src="resources/s.gif" class="item-icon icon-method">Methods</a>
- <a class="inner-link" href="#Roo.KeyMap-events"><img src="resources/s.gif" class="item-icon icon-event">Events</a>
- <a class="inner-link" href="#Roo.KeyMap-configs"><img src="resources/s.gif" class="item-icon icon-config">Config Options</a>
- <a class="bookmark" href="NEED_TO_CREATE_DIRECT_LINK_HREF"><img src="resources/s.gif" class="item-icon icon-fav">Direct Link</a>
- -->
- </div>
-
-
-<!-- ============================== inheritance Block. ================================= -->
-
-<!-- ============================== class title / details ============================ -->
-
-
- <h1 class="classTitle">
-
- Class Roo.KeyMap
- </h1>
-
- <table cellspacing="0" class="class-summary-table">
-
- <tr><td class="label">Package:</td><td class="hd-info">Roo</td></tr>
-
- <tr><td class="label">Defined In:</td><td class="hd-info">
-
- <a href="./src/Roo_KeyMap.js.html">Roo/KeyMap.js</a>.
-
- </td></tr>
- <tr><td class="label">Class:</td><td class="hd-info">KeyMap</td></tr>
-
-
-
-
- </table>
-
-
-<!-- ============================== class summary ========================== -->
- <div class="description">
- Handles mapping keys to actions for an element. One key map can be used for multiple actions.<br/>The constructor accepts the same config object as defined by {<b>link</b> <b>addBinding</b>}.<br/>If you bind a callback function to a KeyMap, anytime the KeyMap handles an expected key<br/>combination it will call the function with this signature (if the match is a multi-key<br/>combination the callback will still be called only once): (String key, Roo.EventObject e)<br/>A KeyMap can also handle a string representation of keys.<br /><br/>Usage:<br/> <pre><code><br/>// map one key by key code<br/>var map = new Roo.KeyMap("my-element", {<br/> key: 13, // or Roo.EventObject.ENTER<br/> fn: myHandler,<br/> scope: myObject<br/>});<br/><br/>// map multiple keys to one action by string<br/>var map = new Roo.KeyMap("my-element", {<br/> key: "a\r\n\t",<br/> fn: myHandler,<br/> scope: myObject<br/>});<br/><br/>// map multiple keys to multiple actions by strings and array of codes<br/>var map = new Roo.KeyMap("my-element", [<br/> {<br/> key: [10,13],<br/> fn: function(){ alert("Return was pressed"); }<br/> }, {<br/> key: "abc",<br/> fn: function(){ alert('a, b or c was pressed'); }<br/> }, {<br/> key: "\t",<br/> ctrl:true,<br/> shift:true,<br/> fn: function(){ alert('Control + shift + tab was pressed.'); }<br/> }<br/>]);<br/></code></pre><br/><b>Note: A KeyMap starts enabled</b>
- </div>
-
-
-<!-- ============================== Class comment block... ========================== -->
-
-<div class="comments">
- <b>Class Comments / Notes</B> =>
- <u onclick="parent.CommentDialog.showCommentId = 'Roo.KeyMap';">[Add Your comment/notes about this class]</u>
- <br/>
- <iframe frameborder="0" id="comments-Roo" style="border: none;width:100%;"
- src="/blog.php/GtkDjsComments/Roo.KeyMap.html"></iframe>
-</div>
-
-
-
-<!-- ============================== config options ========================== -->
-
-
-
-
- <div class="hr"></div>
- <a id="Roo.KeyMap-configs"></a>
-
-
-
- <table cellspacing="0" class="member-table">
- <caption class="Empty">Config Options - Has None</caption>
- </table>
-
-
-
-
-
-
-
-
-
-
-
-
- <!-- ============================== public properties ==================== -->
-
-
-
- <a id="Roo.KeyMap-props"></a>
-
-
-
-
-
- <table cellspacing="0" class="member-table">
- <caption class="Empty">Public Properties - Has None</caption>
- </table>
-
-
-
-
- <!-- ============================== methods summary / details ======================== -->
-
-
- <a id="Roo.KeyMap-methods"></a>
- <!-- constructor?? -->
-
- <!-- static's first
-
-
- -->
-
- <!-- then dynamics first -->
-
-
-
-
-
-
- <table cellspacing="0" class="member-table">
- <caption>Public Methods</caption>
- <tr>
- <th class="sig-header" colspan="2">Method</th>
- <th class="msource-header">Defined By</th>
-
- </tr>
-
-
-
-
-
-
-
- <tr class="method-row config-row-alt0 expandable notInherited">
- <td class="micon"><a class="exi" href="#expand"> </a></td>
-
-
- <td class="sig">
- <a id="Roo-method-KeyMap" name=".KeyMap"></a>
- <div class="fixedFont">
- <span class="attributes">new <B>Roo.</B></span><b class="itemname">KeyMap</b>
-
- (<a href="./String.html#constructor" roo:cls="String.html#constructor">String</a>/HTMLElement/Roo.Element <B><i>el</i></B>, <a href="http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Object">Object</a> <B><i>config</i></B>, <a href="./String.html#constructor" roo:cls="String.html#constructor">String</a> <B><i>eventName</i></B>)
-
-
-
- </div>
- <div class="mdesc">
-
-
- <div class="short">Create a new Roo.KeyMap</div>
-
-
- <div class="long">
-
-
-
- Create a new Roo.KeyMap
-
-
- <dl class="detailList">
- <dt class="heading">Parameters:</dt>
-
- <dt>
- <span class="fixedFont"><a href="./String.html#constructor" roo:cls="String.html#constructor">String</a>/HTMLElement/Roo.Element</span> <b>el</b>
-
- </dt>
- <dd>The element to bind to</dd>
-
- <dt>
- <span class="fixedFont"><a href="http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Object">Object</a></span> <b>config</b>
-
- </dt>
- <dd>The config (see {<b>link</b> <b>addBinding</b>})</dd>
-
- <dt>
- <span class="fixedFont"><a href="./String.html#constructor" roo:cls="String.html#constructor">String</a></span> <b>eventName</b>
-
- </dt>
- <dd>(optional) The event to bind to (defaults to "keydown")</dd>
-
- </dl>
-
-
-
-
-
-
-
-
-
-
-
- </div>
- </div>
-
- </td>
- <td class="msource">
-
- </td>
- </tr>
-
-
- <tr class="method-row config-row-alt1 expandable notInherited">
- <td class="micon"><a class="exi" href="#expand"> </a></td>
-
-
- <td class="sig">
- <a id="Roo.KeyMap-method-addBinding" name=".addBinding"></a>
- <div class="fixedFont">
- <span class="attributes"></span><b class="itemname">addBinding</b>
-
- (<a href="http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Object">Object</a>/Array <B><i>config</i></B>)
-
-
-
- </div>
- <div class="mdesc">
-
- <div class="short">Add a new binding to this KeyMap.</div>
-
-
-
- <div class="long">
-
- Add a new binding to this KeyMap. The following config object properties are supported:<br/><pre><br/>Property Type Description<br/>---------- --------------- ----------------------------------------------------------------------<br/>key String/Array A single keycode or an array of keycodes to handle<br/>shift Boolean True to handle key only when shift is pressed (defaults to false)<br/>ctrl Boolean True to handle key only when ctrl is pressed (defaults to false)<br/>alt Boolean True to handle key only when alt is pressed (defaults to false)<br/>fn Function The function to call when KeyMap finds the expected key combination<br/>scope Object The scope of the callback function<br/></pre><br/><br/>Usage:<br/><pre><code><br/>// Create a KeyMap<br/>var map = new Roo.KeyMap(document, {<br/> key: Roo.EventObject.ENTER,<br/> fn: handleKey,<br/> scope: this<br/>});<br/><br/>//Add a new binding to the existing KeyMap later<br/>map.addBinding({<br/> key: 'abc',<br/> shift: true,<br/> fn: handleKey,<br/> scope: this<br/>});<br/></code></pre>
-
-
-
-
-
-
- <dl class="detailList">
- <dt class="heading">Parameters:</dt>
-
- <dt>
- <span class="fixedFont"><a href="http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Object">Object</a>/Array</span> <b>config</b>
-
- </dt>
- <dd>A single KeyMap config or an array of configs</dd>
-
- </dl>
-
-
-
-
-
-
-
-
-
-
-
- </div>
- </div>
-
- </td>
- <td class="msource">
-
- Roo.KeyMap
-
- </td>
- </tr>
-
-
- <tr class="method-row config-row-alt0 expandable notInherited">
- <td class="micon"><a class="exi" href="#expand"> </a></td>
-
-
- <td class="sig">
- <a id="Roo.KeyMap-method-disable" name=".disable"></a>
- <div class="fixedFont">
- <span class="attributes"></span><b class="itemname">disable</b>
-
- ()
-
-
-
- </div>
- <div class="mdesc">
-
- <div class="short">Disable this KeyMap</div>
-
-
-
- <div class="long">
-
- Disable this KeyMap
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- </div>
- </div>
-
- </td>
- <td class="msource">
-
- Roo.KeyMap
-
- </td>
- </tr>
-
-
- <tr class="method-row config-row-alt1 expandable notInherited">
- <td class="micon"><a class="exi" href="#expand"> </a></td>
-
-
- <td class="sig">
- <a id="Roo.KeyMap-method-enable" name=".enable"></a>
- <div class="fixedFont">
- <span class="attributes"></span><b class="itemname">enable</b>
-
- ()
-
-
-
- </div>
- <div class="mdesc">
-
- <div class="short">Enables this KeyMap</div>
-
-
-
- <div class="long">
-
- Enables this KeyMap
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- </div>
- </div>
-
- </td>
- <td class="msource">
-
- Roo.KeyMap
-
- </td>
- </tr>
-
-
- <tr class="method-row config-row-alt0 expandable notInherited">
- <td class="micon"><a class="exi" href="#expand"> </a></td>
-
-
- <td class="sig">
- <a id="Roo.KeyMap-method-isEnabled" name=".isEnabled"></a>
- <div class="fixedFont">
- <span class="attributes"></span><b class="itemname">isEnabled</b>
-
- ()
-
-
- :
-
-
- <a href="http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Boolean">Boolean</a>
-
-
-
-
-
- </div>
- <div class="mdesc">
-
- <div class="short">Returns true if this KeyMap is enabled</div>
-
-
-
- <div class="long">
-
- Returns true if this KeyMap is enabled
-
-
-
-
-
-
-
-
-
-
- <dl class="detailList">
- <dt class="heading">Returns:</dt>
-
- <dd><span class="fixedFont"><a href="http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Boolean">Boolean</a></span> </dd>
-
- </dl>
-
-
-
-
-
-
-
- </div>
- </div>
-
- </td>
- <td class="msource">
-
- Roo.KeyMap
-
- </td>
- </tr>
-
-
- <tr class="method-row config-row-alt1 expandable notInherited">
- <td class="micon"><a class="exi" href="#expand"> </a></td>
-
-
- <td class="sig">
- <a id="Roo.KeyMap-method-on" name=".on"></a>
- <div class="fixedFont">
- <span class="attributes"></span><b class="itemname">on</b>
-
- (<a href="./Number.html#constructor" roo:cls="Number.html#constructor">Number</a>/Array/Object <B><i>key</i></B>, <a href="./Function.html#constructor" roo:cls="Function.html#constructor">Function</a> <B><i>fn</i></B>, <a href="http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Object">Object</a> <B><i>scope</i></B>)
-
-
-
- </div>
- <div class="mdesc">
-
- <div class="short">Shorthand for adding a single key listener</div>
-
-
-
- <div class="long">
-
- Shorthand for adding a single key listener
-
-
-
-
-
-
- <dl class="detailList">
- <dt class="heading">Parameters:</dt>
-
- <dt>
- <span class="fixedFont"><a href="./Number.html#constructor" roo:cls="Number.html#constructor">Number</a>/Array/Object</span> <b>key</b>
-
- </dt>
- <dd>Either the numeric key code, array of key codes or an object with the<br/>following options:<br/>{key: (number or array), shift: (true/false), ctrl: (true/false), alt: (true/false)}</dd>
-
- <dt>
- <span class="fixedFont"><a href="./Function.html#constructor" roo:cls="Function.html#constructor">Function</a></span> <b>fn</b>
-
- </dt>
- <dd>The function to call</dd>
-
- <dt>
- <span class="fixedFont"><a href="http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Object">Object</a></span> <b>scope</b>
-
- </dt>
- <dd>(optional) The scope of the function</dd>
-
- </dl>
-
-
-
-
-
-
-
-
-
-
-
- </div>
- </div>
-
- </td>
- <td class="msource">
-
- Roo.KeyMap
-
- </td>
- </tr>
-
-
- </table>
-
-
- <!-- ============================== events summary / details ======================== -->
-
-
- <a id="Roo.KeyMap-events"></a>
-
-
-
-
-
- <table cellspacing="0" class="member-table">
- <caption class="Empty">Events - Has None</caption>
- </table>
-
-
-
-
-
-
-
-
-
-<!-- ============================== footer ================================= -->
- <div class="fineprint" style="clear:both">
-
- Documentation generated by <a href="http://www.akbkhome.com" target="_blankt">Introspection Doc Generator</a> on Fri Jul 13 2018 14:10:53 GMT+0800 (HKT)
- Based on
- <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a>
- </div>
- </body>
-</html>