3 <title>The source code</title>
4 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
5 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
7 <body onload="prettyPrint();">
8 <pre class="prettyprint lang-js">/*!
10 * Copyright(c) 2006-2009 Ext JS, LLC
12 * http://www.extjs.com/license
15 * @class Ext.Element
\r
17 Ext.Element.addMethods({
\r
18 <div id="method-Ext.Element-addKeyListener"></div>/**
\r
19 * Convenience method for constructing a KeyMap
\r
20 * @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
21 * {key: (number or array), shift: (true/false), ctrl: (true/false), alt: (true/false)}
\r
22 * @param {Function} fn The function to call
\r
23 * @param {Object} scope (optional) The scope of the function
\r
24 * @return {Ext.KeyMap} The KeyMap created
\r
26 addKeyListener : function(key, fn, scope){
\r
28 if(!Ext.isObject(key) || Ext.isArray(key)){
\r
44 return new Ext.KeyMap(this, config);
\r
47 <div id="method-Ext.Element-addKeyMap"></div>/**
\r
48 * Creates a KeyMap for this element
\r
49 * @param {Object} config The KeyMap config. See {@link Ext.KeyMap} for more details
\r
50 * @return {Ext.KeyMap} The KeyMap created
\r
52 addKeyMap : function(config){
\r
53 return new Ext.KeyMap(this, config);
\r