3 * Copyright(c) 2006-2010 Sencha Inc.
5 * http://www.sencha.com/license
10 Ext.Element.addMethods({
12 * Convenience method for constructing a KeyMap
13 * @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:
14 * <code>{key: (number or array), shift: (true/false), ctrl: (true/false), alt: (true/false)}</code>
15 * @param {Function} fn The function to call
16 * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the specified function is executed. Defaults to this Element.
17 * @return {Ext.KeyMap} The KeyMap created
19 addKeyListener : function(key, fn, scope){
21 if(typeof key != 'object' || Ext.isArray(key)){
37 return new Ext.KeyMap(this, config);
41 * Creates a KeyMap for this element
42 * @param {Object} config The KeyMap config. See {@link Ext.KeyMap} for more details
43 * @return {Ext.KeyMap} The KeyMap created
45 addKeyMap : function(config){
46 return new Ext.KeyMap(this, config);
50 //Import the newly-added Ext.Element functions into CompositeElementLite. We call this here because
51 //Element.keys.js is the last extra Ext.Element include in the ext-all.js build
52 Ext.CompositeElementLite.importElementMethods();