0

I'm having a strange problem. I have an ancient microsoft sidewinder version 1 gamepad laying around, And since I'm learning javascript/html5 I thought let's try the gamepad in browser.

I tried it on linux (my laptop, ubuntu 13.04) did:
navigator.webkitGetGamepads()[0] in the console of my chrome browser (version 28.0.1500.71) and the gamepad was detected right away.

Than I tried the same thing on my windows 7 64 bit desktop, running Version 30.0.1599.101 m did: navigator.webkitGetGamepads()[0] in the console, but no luck here, it keeps telling me undefined. When I go to "my devices" in windows, the gamepad is there.

screenshot

(https://www.dropbox.com/s/yam4fj5zqiogyjh/gamepad.png)

I have the same problem on my laptop running windows 8, 64 bit.

I have no idea what's wrong, and I have no idea how to fix it. (I hope it's fixable)
Please help

Passerby
  • 9,715
  • 2
  • 33
  • 50
Bosiwow
  • 2,025
  • 3
  • 28
  • 46
  • What do you see if you just do `navigator.webkitGetGamepads()`? As it could be under a different array key. – Ben Fortune Oct 22 '13 at 10:18
  • all the elements are undefined :(. Can it be that the gamepad doesn't work under windows because it doesn't support XInput ? – Bosiwow Oct 22 '13 at 10:49
  • It's not just you. I have Windows 8.1 and a generic USB gamepad and no luck with the Gamepad API. Seems like others have this issues as well: code.google.com/p/chromium/issues/detail?id=144843 So the best you can do is star this issue and wait for the fix. – NagyI Dec 21 '13 at 21:35

2 Answers2

2

You might want to try the most known gamepad testing scripts first.

Chrome: http://www.html5rocks.com/en/tutorials/doodles/gamepad/gamepad-tester/tester.html

Firefox (28, use Aurora) : http://luser.github.io/gamepadtest/

If your Gamepad is using DirectInput and not XInput you may have some issues with Chrome, but it will work fine with Firefox then. For instance, I had the same problem with the PS4 Gamepad.

RRoquais
  • 91
  • 5
0

The spec is unfinished, but this repository is a great start. Try it:

https://github.com/luser/gamepadtest

It attempts to account for differences in implementations of the unfinished spec, as well as Chrome's prefixed implementation.

Thomas Deutsch
  • 2,344
  • 2
  • 27
  • 36