Keyboard.prototype.options.nonParsedEvents.combine(["rebound","onrebound"]);Keyboard.implement({addShortcut:function(name,shortcut){this._shortcuts=this._shortcuts||[];this._shortcutIndex=this._shortcutIndex||{};shortcut.getKeyboard=Function.from(this);shortcut.name=name;this._shortcutIndex[name]=shortcut;this._shortcuts.push(shortcut);if(shortcut.keys){this.addEvent(shortcut.keys,shortcut.handler)}return this},addShortcuts:function(obj){for(var name in obj){this.addShortcut(name,obj[name])}return this},removeShortcut:function(name){var shortcut=this.getShortcut(name);if(shortcut&&shortcut.keys){this.removeEvent(shortcut.keys,shortcut.handler);delete this._shortcutIndex[name];this._shortcuts.erase(shortcut)}return this},removeShortcuts:function(names){names.each(this.removeShortcut,this);return this},getShortcuts:function(){return this._shortcuts||[]},getShortcut:function(name){return(this._shortcutIndex||{})[name]}});Keyboard.rebind=function(newKeys,shortcuts){Array.from(shortcuts).each(function(shortcut){shortcut.getKeyboard().removeEvent(shortcut.keys,shortcut.handler);shortcut.getKeyboard().addEvent(newKeys,shortcut.handler);shortcut.keys=newKeys;shortcut.getKeyboard().fireEvent("rebound")})};Keyboard.getActiveShortcuts=function(keyboard){var activeKBS=[],activeSCS=[];Keyboard.each(keyboard,[].push.bind(activeKBS));activeKBS.each(function(kb){activeSCS.extend(kb.getShortcuts())});return activeSCS};Keyboard.getShortcut=function(name,keyboard,opts){opts=opts||{};var shortcuts=opts.many?[]:null,set=opts.many?function(kb){var shortcut=kb.getShortcut(name);if(shortcut){shortcuts.push(shortcut)}}:function(kb){if(!shortcuts){shortcuts=kb.getShortcut(name)}};Keyboard.each(keyboard,set);return shortcuts};Keyboard.getShortcuts=function(name,keyboard){return Keyboard.getShortcut(name,keyboard,{many:true})};