static/ext/src/util/KeyMap.js
function(binding){
        var me = this,
            keyCode = binding.key,
            i,
            len;

        if (me.processing) {
            me.bindings = bindings.slice(0);
        }
        
        if (Ext.isArray(binding)) {
            for (i = 0, len = binding.length; i < len; i++) {
                me.addBinding(binding[i]);
            }
            return;
        }

        me.bindings.push(Ext.apply({
            keyCode: me.processKeys(keyCode)
        }, binding));
    }
function(binding){
        var me = this,
            keyCode = binding.key,
            i,
            len;

        if (me.processing) {
            me.bindings = bindings.slice(0);
        }
        
        if (Ext.isArray(binding)) {
            for (i = 0, len = binding.length; i < len; i++) {
                me.addBinding(binding[i]);
            }
            return;
        }

        me.bindings.push(Ext.apply({
            keyCode: me.processKeys(keyCode)
        }, binding));
    }
Add a new binding to this KeyMap.

Usage:

// Create a KeyMap
var map = new Ext.util.KeyMap(document, {
key: Ext.EventObject.ENTER,
fn: handleKey,
scope: this
});

//Add a new binding to the existing KeyMap later
map.addBinding({
key: 'abc',
shift: true,
fn: handleKey,
scope: this
});

@param {Object/Object[]} binding A single KeyMap config or an array of configs.
The following config object properties are supported:
@param {String/Array} binding.key A single keycode or an array of keycodes to handle.
@param {Boolean} binding.shift True to handle key only when shift is pressed,
False to handle the keyonly when shift is not pressed (defaults to undefined).
@param {Boolean} binding.ctrl True to handle key only when ctrl is pressed,
False to handle the key only when ctrl is not pressed (defaults to undefined).
@param {Boolean} binding.alt True to handle key only when alt is pressed,
False to handle the key only when alt is not pressed (defaults to undefined).
@param {Function} binding.handler The function to call when KeyMap finds the
expected key combination.
@param {Function} binding.fn Alias of handler (for backwards-compatibility).
@param {Object} binding.scope The scope of the callback function.
@param {String} binding.defaultEventAction A default action to apply to the event.
Possible values are: stopEvent, stopPropagation, preventDefault. If no value is
set no action is performed..