2 * @class Ext.core.Element
4 Ext.core.Element.addMethods({
6 * Convenience method for constructing a KeyMap
7 * @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:
8 * <code>{key: (number or array), shift: (true/false), ctrl: (true/false), alt: (true/false)}</code>
9 * @param {Function} fn The function to call
10 * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the specified function is executed. Defaults to this Element.
11 * @return {Ext.util.KeyMap} The KeyMap created
13 addKeyListener : function(key, fn, scope){
15 if(typeof key != 'object' || Ext.isArray(key)){
31 return Ext.create('Ext.util.KeyMap', this, config);
35 * Creates a KeyMap for this element
36 * @param {Object} config The KeyMap config. See {@link Ext.util.KeyMap} for more details
37 * @return {Ext.util.KeyMap} The KeyMap created
39 addKeyMap : function(config){
40 return Ext.create('Ext.util.KeyMap', this, config);
44 //Import the newly-added Ext.core.Element functions into CompositeElementLite. We call this here because
45 //Element.keys.js is the last extra Ext.core.Element include in the ext-all.js build
46 Ext.CompositeElementLite.importElementMethods();