function SyncInput(){}VERSION="SyncInput V1.1";TIMESTAMP="201702041904";function Vector2(a,b){this.x=void 0!==a?a:0;this.y=void 0!==b?b:0}Vector2.prototype.set=function(a,b){this.x=a;this.y=b};function Key(){this.justReleased=this.justPressed=this.pressed=!1}Key.DOWN=-1;Key.UP=1;Key.RESET=0;Key.prototype.update=function(a){this.justReleased=this.justPressed=!1;a===Key.DOWN?(this.pressed||(this.justPressed=!0),this.pressed=!0):a===Key.UP?(this.pressed&&(this.justReleased=!0),this.pressed=!1):a===Key.RESET&&(this.justPressed=this.justReleased=!1)};Key.prototype.set=function(a,b,c){this.pressed=b;this.justPressed=a;this.justReleased=c}; Key.prototype.reset=function(){this.justReleased=this.justPressed=this.pressed=!1};function Mouse(){this._keys=[];this._position=new Vector2(0,0);this._positionUpdated=!1;this._delta=new Vector2(0,0);this._wheel=0;this._doubleClicked=this._wheelUpdated=!1;this.keys=[];this.position=new Vector2(0,0);this.delta=new Vector2(0,0);this.wheel=0;this.doubleClicked=!1;this.canvas=null;this.events=[];for(var a=0;3>a;a++)this._keys.push(new Key),this.keys.push(new Key);var b=this;void 0!==window.onmousewheel?this.events.push([window,"mousewheel",function(a){b._wheel=a.deltaY;b._wheelUpdated= !0}]):void 0!==window.addEventListener?this.events.push([window,"DOMMouseScroll",function(a){b._wheel=30*a.detail;b._wheelUpdated=!0}]):this.events.push([window,"wheel",function(a){b._wheel=a.deltaY;b._wheelUpdated=!0}]);if("ontouchstart"in window||0a;a++)this.keys.push(new Key);this.events=[];var b=this.actions;this.events.push([window,"keydown",function(a){b.push(a.keyCode);b.push(Key.DOWN)}]);this.events.push([window,"keyup",function(a){b.push(a.keyCode);b.push(Key.UP)}]);for(a=0;aa;){var b=this.actions.shift(),c=this.actions.shift();this.keys[b].update(c);if(this.keys[b].justReleased||this.keys[b].justPressed)this.actions.push(b),this.actions.push(Key.RESET),a+=2}};Keyboard.prototype.reset=function(){this.actions=[];for(var a=0;athis.buttons.length||0>a?0:this.gamepad.buttons[a].value};Gamepad.prototype.getAxis=function(a){return a>this.gamepad.axes.length||0>a?0:this.gamepad.axes[button].value}; Gamepad.prototype.buttonPressed=function(a){return a>this.buttons.length?!1:this.buttons[a].pressed};Gamepad.prototype.buttonJustPressed=function(a){return a>this.buttons.length||0>a?!1:this.buttons[a].justPressed};Gamepad.prototype.buttonJustReleased=function(a){return a>this.buttons.length||0>a?!1:this.buttons[a].justReleased};Gamepad.prototype.dispose=function(){var a=Gamepad.gamepads.indexOf(this);-1!==a&&Gamepad.gamepads.splice(a,1)};Gamepad.gamepads=[];Gamepad.getGamepads=function(){return navigator.getGamepads()}; Gamepad.startListener=function(){window.addEventListener("gamepadconnected",function(a){a=a.gamepad;for(var b=0;b