/*! * KeyboardJS * * Copyright 2011, Robert William Hurst * Licenced under the BSD License. * See https://raw.github.com/RobertWHurst/KeyboardJS/master/license.txt */(function(context,factory){if(typeof define==='function'&&define.amd){define(factory);}else{context.k=context.KeyboardJS=factory();}}(this,function(){function bind(target,type,handler){if(target.addEventListener){target.addEventListener(type,handler,false);}else{target.attachEvent("on"+type,function(event){return handler.call(target,event);});}} [].indexOf||(Array.prototype.indexOf=function(a,b,c){for(c=this.length,b=(c+~~b)%c;b-1){activeKeys.splice(iAK,1);}}} return pruneActiveKeyBindings(event);});bind(window,"blur",function(){activeKeys=[];return pruneActiveKeyBindings(event);});function queryActiveBindings(){var bindingStack=[];for(var keyCount=keyBindingGroups.length;keyCount>-1;keyCount-=1){if(keyBindingGroups[keyCount]){var KeyBindingGroup=keyBindingGroups[keyCount];for(var bindingIndex=0;bindingIndex-1){usesSpentKey=true;break;}} if(!usesSpentKey){if(typeof binding.callback==="function"){if(!binding.callback(event,binding.keys,binding.keyCombo)){output=false}} if(!activeBindings[binding.keyCombo]){activeBindings[binding.keyCombo]=binding;} for(var keyIndex=0;keyIndex-1){var index=keyBindingGroups[keys.length].indexOf(keyBinding);keyBindingGroups[keys.length].splice(index,1);}}} var bindSets=keyCombo.toLowerCase().replace(/\s/g,'').split(',');for(var i=0;i-1;iKCL-=1){if(keyBindingGroups[iKCL]){var KeyBindingGroup=keyBindingGroups[iKCL];for(var iB=0;iB