dist/ui/chico.js
function (shortcut, name, callback) {

                if (this._collection[name] === undefined) {
                    this._collection[name] = {};
                }

                if (this._collection[name][shortcut] === undefined) {
                    this._collection[name][shortcut] = [];
                }

                this._collection[name][shortcut].push(callback);

                return this;

            }
function (shortcut, name, callback) {

                if (this._collection[name] === undefined) {
                    this._collection[name] = {};
                }

                if (this._collection[name][shortcut] === undefined) {
                    this._collection[name][shortcut] = [];
                }

                this._collection[name][shortcut].push(callback);

                return this;

            }
function ( shortcut , name , callback ) { if ( this . _collection [ name ] === undefined ) { this . _collection [ name ] = { } ; } if ( this . _collection [ name ] [ shortcut ] === undefined ) { this . _collection [ name ] [ shortcut ] = [ ] ; } this . _collection [ name ] [ shortcut ] . push ( callback ) ; return this ; }
Add a callback to a shortcut with given name.
@param {(ch.onkeybackspace | ch.onkeytab | ch.onkeyenter | ch.onkeyesc | ch.onkeyleftarrow | ch.onkeyuparrow | ch.onkeyrightarrow | ch.onkeydownarrow)} shortcut Shortcut to subscribe.
@param {String} name A name to add in the collection.
@param {Function} callback A given function.
@returns {Object} Retuns the ch.shortcuts.
@example
// Add a callback to ESC key with "component" name.
ch.shortcuts.add(ch.onkeyesc, 'component', component.hide);
Add a callback to a shortcut with given name .