/*!keymaster.js (c) 2011-2013 Thomas Fuchs | MIT */ !function(e){function n(e,n){for(var t=e.length;t--;)if(e[t]===n)return t;return-1}function t(e,n){if(e.length!=n.length)return!1;for(var t=0;t0;for(i in b)(!b[i]&&n(r.mods,+i)>-1||b[i]&&-1==n(r.mods,+i))&&(c=!1);(0!=r.mods.length||b[16]||b[18]||b[17]||b[91])&&!c||r.method(e,r)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}function i(e){var t,o=e.keyCode,r=n(S,o);if(r>=0&&S.splice(r,1),(93==o||224==o)&&(o=91),o in b){b[o]=!1;for(t in C)C[t]==o&&(f[t]=!1)}}function l(){for(m in b)b[m]=!1;for(m in C)f[m]=!1}function f(e,n,t){var o,r,i=!1;o=g(e),void 0===t&&(t=n,n="all"),i=!("string"==typeof n||!n.length||"string"!=typeof n[0]);for(var l=0;l1&&(r=y(e),e=[e[e.length-1]]),e=e[0],e=P(e),e in E||(E[e]=[]),i)for(var f=0;f1&&(c=y(r),e=r[r.length-1]),e=P(e),void 0===n&&(n=d()),!E[e])return;for(i=0;im;m++)K["f"+m]=111+m;var T={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey"};for(m in C)f[m]=!1;v(document,"keydown",function(e){r(e)}),v(document,"keyup",i),v(window,"focus",l);var A=e.key;e.key=f,e.key.setScope=p,e.key.getScope=d,e.key.deleteScope=h,e.key.filter=s,e.key.isPressed=u,e.key.getPressedKeyCodes=a,e.key.noConflict=k,e.key.unbind=c,"undefined"!=typeof module&&(module.exports=key)}(this);