3 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
\r
4 <title>The source code</title>
\r
5 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
\r
6 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
\r
8 <body onload="prettyPrint();">
\r
9 <pre class="prettyprint lang-js">/**
\r
10 * @class Ext.Element
\r
12 Ext.Element.addMethods({
\r
13 <div id="method-Ext.Element-addKeyListener"></div>/**
\r
14 * Convenience method for constructing a KeyMap
\r
15 * @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
16 * <code>{key: (number or array), shift: (true/false), ctrl: (true/false), alt: (true/false)}</code>
\r
17 * @param {Function} fn The function to call
\r
18 * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the specified function is executed. Defaults to this Element.
\r
19 * @return {Ext.KeyMap} The KeyMap created
\r
21 addKeyListener : function(key, fn, scope){
\r
23 if(!Ext.isObject(key) || Ext.isArray(key)){
\r
39 return new Ext.KeyMap(this, config);
\r
42 <div id="method-Ext.Element-addKeyMap"></div>/**
\r
43 * Creates a KeyMap for this element
\r
44 * @param {Object} config The KeyMap config. See {@link Ext.KeyMap} for more details
\r
45 * @return {Ext.KeyMap} The KeyMap created
\r
47 addKeyMap : function(config){
\r
48 return new Ext.KeyMap(this, config);
\r