!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.keyboardJS=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o-1&&r.splice(n,1)}if(0!==r.length)return!1}return!0},KeyCombo._splitStr=function(o,e){for(var t=o,r=e,s="",i=[],n=0;n0&&t[n]===r&&"\\"!==t[n-1]&&(i.push(s.trim()),s="",n+=1),s+=t[n];return s&&i.push(s.trim()),i},KeyCombo.prototype._checkSubCombo=function(o,e,t){o=o.slice(0),t=t.slice(e);for(var r=e,s=0;s-1&&(o.splice(s,1),s-=1,b>r&&(r=b),0===o.length))return r}return-1},module.exports=KeyCombo; },{}],3:[function(require,module,exports){ (function (global){ function Keyboard(e,t,n,o){this._locale=null,this._currentContext=null,this._contexts={},this._listeners=[],this._appliedListeners=[],this._locales={},this._targetElement=null,this._targetWindow=null,this._targetPlatform="",this._targetUserAgent="",this._isModernBrowser=!1,this._targetKeyDownBinding=null,this._targetKeyUpBinding=null,this._targetResetBinding=null,this._paused=!1,this.setContext("global"),this.watch(e,t,n,o)}var Locale=require("./locale"),KeyCombo=require("./key-combo");Keyboard.prototype.setLocale=function(e,t){var n=null;"string"==typeof e?t?(n=new Locale(e),t(n,this._targetPlatform,this._targetUserAgent)):n=this._locales[e]||null:(n=e,e=n._localeName),this._locale=n,this._locales[e]=n,n&&(this._locale.pressedKeys=n.pressedKeys)},Keyboard.prototype.getLocale=function(e){return e||(e=this._locale.localeName),this._locales[e]||null},Keyboard.prototype.bind=function(e,t,n,o){if((null===e||"function"==typeof e)&&(o=n,n=t,t=e,e=null),e&&"object"==typeof e&&"number"==typeof e.length)for(var r=0;r-1&&s.push(0|t)}return s},Locale.prototype.getKeyNames=function(e){return this._keyMap[e]||[]},Locale.prototype.setKillKey=function(e){if("string"!=typeof e)this._killKeyCodes.push(e);else for(var s=this.getKeyCodes(e),t=0;t-1)this.pressedKeys.length=0;else for(var t=0;t-1&&this.pressedKeys.splice(i,1)}this._clearMacros()}},Locale.prototype._applyMacros=function(){for(var e=this._macros.slice(0),s=0;s-1&&this.pressedKeys.splice(o,1)}s.handler&&(s.keyNames=null),this._appliedMacros.splice(e,1),e-=1}}},module.exports=Locale; },{"./key-combo":2}],5:[function(require,module,exports){ module.exports=function(e,d,n){e.bindKeyCode(3,["cancel"]),e.bindKeyCode(8,["backspace"]),e.bindKeyCode(9,["tab"]),e.bindKeyCode(12,["clear"]),e.bindKeyCode(13,["enter"]),e.bindKeyCode(16,["shift"]),e.bindKeyCode(17,["ctrl"]),e.bindKeyCode(18,["alt","menu"]),e.bindKeyCode(19,["pause","break"]),e.bindKeyCode(20,["capslock"]),e.bindKeyCode(27,["escape","esc"]),e.bindKeyCode(32,["space","spacebar"]),e.bindKeyCode(33,["pageup"]),e.bindKeyCode(34,["pagedown"]),e.bindKeyCode(35,["end"]),e.bindKeyCode(36,["home"]),e.bindKeyCode(37,["left"]),e.bindKeyCode(38,["up"]),e.bindKeyCode(39,["right"]),e.bindKeyCode(40,["down"]),e.bindKeyCode(41,["select"]),e.bindKeyCode(42,["printscreen"]),e.bindKeyCode(43,["execute"]),e.bindKeyCode(44,["snapshot"]),e.bindKeyCode(45,["insert","ins"]),e.bindKeyCode(46,["delete","del"]),e.bindKeyCode(47,["help"]),e.bindKeyCode(145,["scrolllock","scroll"]),e.bindKeyCode(187,["equal","equalsign","="]),e.bindKeyCode(188,["comma",","]),e.bindKeyCode(190,["period","."]),e.bindKeyCode(191,["slash","forwardslash","/"]),e.bindKeyCode(192,["graveaccent","`"]),e.bindKeyCode(219,["openbracket","["]),e.bindKeyCode(220,["backslash","\\"]),e.bindKeyCode(221,["closebracket","]"]),e.bindKeyCode(222,["apostrophe","'"]),e.bindKeyCode(48,["zero","0"]),e.bindKeyCode(49,["one","1"]),e.bindKeyCode(50,["two","2"]),e.bindKeyCode(51,["three","3"]),e.bindKeyCode(52,["four","4"]),e.bindKeyCode(53,["five","5"]),e.bindKeyCode(54,["six","6"]),e.bindKeyCode(55,["seven","7"]),e.bindKeyCode(56,["eight","8"]),e.bindKeyCode(57,["nine","9"]),e.bindKeyCode(96,["numzero","num0"]),e.bindKeyCode(97,["numone","num1"]),e.bindKeyCode(98,["numtwo","num2"]),e.bindKeyCode(99,["numthree","num3"]),e.bindKeyCode(100,["numfour","num4"]),e.bindKeyCode(101,["numfive","num5"]),e.bindKeyCode(102,["numsix","num6"]),e.bindKeyCode(103,["numseven","num7"]),e.bindKeyCode(104,["numeight","num8"]),e.bindKeyCode(105,["numnine","num9"]),e.bindKeyCode(106,["nummultiply","num*"]),e.bindKeyCode(107,["numadd","num+"]),e.bindKeyCode(108,["numenter"]),e.bindKeyCode(109,["numsubtract","num-"]),e.bindKeyCode(110,["numdecimal","num."]),e.bindKeyCode(111,["numdivide","num/"]),e.bindKeyCode(144,["numlock","num"]),e.bindKeyCode(112,["f1"]),e.bindKeyCode(113,["f2"]),e.bindKeyCode(114,["f3"]),e.bindKeyCode(115,["f4"]),e.bindKeyCode(116,["f5"]),e.bindKeyCode(117,["f6"]),e.bindKeyCode(118,["f7"]),e.bindKeyCode(119,["f8"]),e.bindKeyCode(120,["f9"]),e.bindKeyCode(121,["f10"]),e.bindKeyCode(122,["f11"]),e.bindKeyCode(123,["f12"]),e.bindMacro("shift + `",["tilde","~"]),e.bindMacro("shift + 1",["exclamation","exclamationpoint","!"]),e.bindMacro("shift + 2",["at","@"]),e.bindMacro("shift + 3",["number","#"]),e.bindMacro("shift + 4",["dollar","dollars","dollarsign","$"]),e.bindMacro("shift + 5",["percent","%"]),e.bindMacro("shift + 6",["caret","^"]),e.bindMacro("shift + 7",["ampersand","and","&"]),e.bindMacro("shift + 8",["asterisk","*"]),e.bindMacro("shift + 9",["openparen","("]),e.bindMacro("shift + 0",["closeparen",")"]),e.bindMacro("shift + -",["underscore","_"]),e.bindMacro("shift + =",["plus","+"]),e.bindMacro("shift + [",["opencurlybrace","opencurlybracket","{"]),e.bindMacro("shift + ]",["closecurlybrace","closecurlybracket","}"]),e.bindMacro("shift + \\",["verticalbar","|"]),e.bindMacro("shift + ;",["colon",":"]),e.bindMacro("shift + '",["quotationmark","'"]),e.bindMacro("shift + !,",["openanglebracket","<"]),e.bindMacro("shift + .",["closeanglebracket",">"]),e.bindMacro("shift + /",["questionmark","?"]);for(var i=65;90>=i;i+=1){var o=String.fromCharCode(i+32),b=String.fromCharCode(i);e.bindKeyCode(i,o),e.bindMacro("shift + "+o,b),e.bindMacro("capslock + "+o,b)}var a,r,c=n.match("Firefox")?59:186,t=n.match("Firefox")?173:189;d.match("Mac")&&(n.match("Safari")||n.match("Chrome"))?(a=91,r=93):d.match("Mac")&&n.match("Opera")?(a=17,r=17):d.match("Mac")&&n.match("Firefox")&&(a=224,r=224),e.bindKeyCode(c,["semicolon",";"]),e.bindKeyCode(t,["dash","-"]),e.bindKeyCode(a,["command","windows","win","super","leftcommand","leftwindows","leftwin","leftsuper"]),e.bindKeyCode(r,["command","windows","win","super","rightcommand","rightwindows","rightwin","rightsuper"]),e.setKillKey("command")}; },{}]},{},[1])(1) });