gamepad.js 563 B

123456789101112131415161718192021
  1. /*!
  2. {
  3. "name": "GamePad API",
  4. "property": "gamepads",
  5. "authors": ["Eric Bidelman"],
  6. "tags": ["media"],
  7. "notes": [{
  8. "name": "W3C Spec",
  9. "href": "https://www.w3.org/TR/gamepad/"
  10. },{
  11. "name": "HTML5 Rocks Tutorial",
  12. "href": "https://www.html5rocks.com/en/tutorials/doodles/gamepad/#toc-featuredetect"
  13. }]
  14. }
  15. !*/
  16. /* DOC
  17. Detects support for the Gamepad API, for access to gamepads and controllers.
  18. */
  19. define(['Modernizr', 'prefixed'], function(Modernizr, prefixed) {
  20. Modernizr.addTest('gamepads', !!prefixed('getGamepads', navigator));
  21. });