0

I'm trying to get my gamepad events in chromium. Everything works perfectly fine on Chrome Version 44.0.2403.130 m with this code :

var gamepadList = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads : []);

But on the WebVR chromium version made by Brandon Jones, I can't get any feedback, the 'navigator.getGamepads()' function returns only an array of four undefined variables.

Is it not supported yet? Or do I need to do something specific?

Thanks for the help!

1 Answers1

1

Seems to work for me using this test page:

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

Keep in mind that, due to fingerprinting privacy concerns, you to press a "face" button on the controller before it is visible to the API.

brianpeiris
  • 10,735
  • 1
  • 31
  • 44
  • Specifically, you have to press one of the "face" buttons. On an Xbox controller, that's one of the colored X, Y, A or B buttons. – brianpeiris Aug 14 '15 at 18:45
  • Yes, indeed I've noticed that you had to activate the gamepad by pressing a button, but that doesn't change a thing for me. I was using the html5 gamepad test too, and it's fine on chrome but the windows version of chromium available here : https://drive.google.com/folderview?id=0BzudLt22BqGRbW9WTHMtOWMzNjQ&usp=sharing#list doesn't do nothing. Is it the one you used ? –  Aug 16 '15 at 20:40
  • 1
    Actually I didn't. It pushed me towards a new way of navigating through the space, with a gaze and wait mode to teleport the user, which in the end is way better as it allows the system to work on all HMDs –  Sep 15 '15 at 18:04