3 <title>The source code</title>
\r
4 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
\r
5 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
\r
7 <body onload="prettyPrint();">
\r
8 <pre class="prettyprint lang-js">/**
\r
11 Ext.Element.addMethods({
\r
12 <div id="method-Ext.Element-addKeyListener"></div>/**
\r
13 * Convenience method for constructing a KeyMap
\r
14 * @param {Number/Array/Object/String} key Either a string with the keys to listen for, the numeric key code, array of key codes or an object with the following options:
\r
15 * {key: (number or array), shift: (true/false), ctrl: (true/false), alt: (true/false)}
\r
16 * @param {Function} fn The function to call
\r
17 * @param {Object} scope (optional) The scope of the function
\r
18 * @return {Ext.KeyMap} The KeyMap created
\r
20 addKeyListener : function(key, fn, scope){
\r
22 if(!Ext.isObject(key) || Ext.isArray(key)){
\r
38 return new Ext.KeyMap(this, config);
\r
41 <div id="method-Ext.Element-addKeyMap"></div>/**
\r
42 * Creates a KeyMap for this element
\r
43 * @param {Object} config The KeyMap config. See {@link Ext.KeyMap} for more details
\r
44 * @return {Ext.KeyMap} The KeyMap created
\r
46 addKeyMap : function(config){
\r
47 return new Ext.KeyMap(this, config);
\r