1 Module['arguments'] = ['0'];
2 //Gamepads don't appear until a button is pressed and the joystick/gamepad tests expect one to be connected
3 Module['preRun'].push(function()
5 Module['print']("Waiting for gamepad...");
6 Module['addRunDependency']("gamepad");
7 window.addEventListener('gamepadconnected', function()
10 Module['removeRunDependency']("gamepad");
14 if(!!navigator.webkitGetGamepads)
16 var timeout = function()
18 if(navigator.webkitGetGamepads()[0] !== undefined)
19 Module['removeRunDependency']("gamepad");
21 setTimeout(timeout, 100);
23 setTimeout(timeout, 100);