3 * Copyright(c) 2006-2009 Ext JS, LLC
5 * http://www.extjs.com/license
10 Ext.Element.addMethods({
\r
12 * Convenience method for constructing a KeyMap
\r
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:
\r
14 * {key: (number or array), shift: (true/false), ctrl: (true/false), alt: (true/false)}
\r
15 * @param {Function} fn The function to call
\r
16 * @param {Object} scope (optional) The scope of the function
\r
17 * @return {Ext.KeyMap} The KeyMap created
\r
19 addKeyListener : function(key, fn, scope){
\r
21 if(!Ext.isObject(key) || Ext.isArray(key)){
\r
37 return new Ext.KeyMap(this, config);
\r
41 * Creates a KeyMap for this element
\r
42 * @param {Object} config The KeyMap config. See {@link Ext.KeyMap} for more details
\r
43 * @return {Ext.KeyMap} The KeyMap created
\r
45 addKeyMap : function(config){
\r
46 return new Ext.KeyMap(this, config);
\r