🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
749 B

  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()
  4. {
  5. Module['print']("Waiting for gamepad...");
  6. Module['addRunDependency']("gamepad");
  7. window.addEventListener('gamepadconnected', function()
  8. {
  9. //OK, got one
  10. Module['removeRunDependency']("gamepad");
  11. }, false);
  12. //chrome
  13. if(!!navigator.webkitGetGamepads)
  14. {
  15. var timeout = function()
  16. {
  17. if(navigator.webkitGetGamepads()[0] !== undefined)
  18. Module['removeRunDependency']("gamepad");
  19. else
  20. setTimeout(timeout, 100);
  21. }
  22. setTimeout(timeout, 100);
  23. }
  24. });