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

3
  • What do you see if you just do navigator.webkitGetGamepads()? As it could be under a different array key. Commented Oct 22, 2013 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
    Commented Oct 22, 2013 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
    Commented Dec 21, 2013 at 21:35

2 Answers 2

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.

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.