3 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4 <title>The source code</title>
5 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
6 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
8 <body onload="prettyPrint();">
9 <pre class="prettyprint lang-js">/*!
10 * Ext JS Library 3.2.1
11 * Copyright(c) 2006-2010 Ext JS, Inc.
13 * http://www.extjs.com/license
18 Ext.Element.addMethods({
19 <div id="method-Ext.Element-addKeyListener"></div>/**
20 * Convenience method for constructing a KeyMap
21 * @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:
22 * <code>{key: (number or array), shift: (true/false), ctrl: (true/false), alt: (true/false)}</code>
23 * @param {Function} fn The function to call
24 * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the specified function is executed. Defaults to this Element.
25 * @return {Ext.KeyMap} The KeyMap created
27 addKeyListener : function(key, fn, scope){
29 if(typeof key != 'object' || Ext.isArray(key)){
45 return new Ext.KeyMap(this, config);
48 <div id="method-Ext.Element-addKeyMap"></div>/**
49 * Creates a KeyMap for this element
50 * @param {Object} config The KeyMap config. See {@link Ext.KeyMap} for more details
51 * @return {Ext.KeyMap} The KeyMap created
53 addKeyMap : function(config){
54 return new Ext.KeyMap(this, config);