/** * Funkey - Functional keyboard event handler * (c) 2016 Piet van Zoen - http://github.com/pietvanzoen/funkey * @version 1.0.3 * @license MIT (http://www.opensource.org/licenses/mit-license.php) */ (function(){"use strict";function t(){function t(t,n){return function(r,i){e[(n||"")+r]=t+i}}var e={tab:9,backspace:8,enter:13,shift:16,ctrl:17,alt:18,pause:19,capslock:20,escape:27,space:32,pageup:33,pagedown:34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,superleft:91,superright:92,select:93,multiply:106,add:107,subtract:109,decimal:110,divide:111,numlock:144,scrolllock:145,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222};return c(t(65),"abcdefghijklmnopqrstuvwxyz"),c(t(48),"0123456789"),c(t(112,"f"),[1,2,3,4,5,6,7,8,9,10,11,12]),c(t(96,"numpad"),[0,1,2,3,4,5,6,7,8,9]),e}function e(t,n,r){var i=y.call(arguments,0,p);return i.length===p?h.apply(this,i):o(p-i.length,function(){return e.apply(this,i.concat(y.call(arguments)))})}function n(t,e){for(var n in t)if(t.hasOwnProperty(n)&&t[n]!==e[n])return!1;return!0}function r(t){var e={shiftKey:!1,altKey:!1,metaKey:!1,ctrlKey:!1},n=t.split(s);return c(function(n){var r=f[n];r&&(e.keyCode=r);var i=l[n];if(i&&(e[i]=!0),!r&&!i)throw new Error('[funkey] Invalid keyName "'+t+'"')},n),e}function i(t){return function(){var e=y.call(arguments),n=a(u,e);e.splice(e.indexOf(n),1);var r=e[0],i=e[1];if(!u(n)||"string"!=typeof r||"function"!=typeof i)throw new Error("[,funkey] Invalid call signature. \nfunkey must be given an event object, a keyName, and a callback function.");return t.call(this,n,r,i)}}function u(t){return"object"==typeof t}function a(t,e){return t(e[0])?e[0]:a(t,y.call(e,1))}function c(t,e){for(var n=-1,r=e.length;++n