Chrome has no gamepadconnected event
I've been using html5gamepad.com just off-and-on through development of EELemental. And reviewing tutorials for gamepad implementation.
All websites trying to provide guidance to implementing gamepads in HTML5 games, have code that works with Window.gamepadconnected even. Unfortunately in the latest version Chrome (Version 58.0.3029.110), this event doesn't fire.
Correction: gamepadconnected does not fire when connecting a gamepad. It *does* fire when DISconnecting a gamepad. Hey! All the tutorial web sites that want you following their guidance say there's also Window.gamepaddisconnected (https://developer.mozilla.org/en-US/docs/Web/Event...) but... yeah it doesn't ever fire.
So the gamepadconnected event fires when disconnecting a gamepad, and the gamepaddisconnected event never fires.
This is taking longer than I have patience for tonight.
EELemental
What dwells below versus what dwells above
Status | In development |
Author | TheEdgeOfThought |
Genre | Action |
Tags | Abstract, artgame, Retro |
Accessibility | Textless |
More posts
- Awkward testing in itch.io HTML5 environmentMay 10, 2017
- Gamepad updatesMay 10, 2017
Comments
Log in with itch.io to leave a comment.
It's true. I have same problem.
https://developer.mozilla.org/en-US/docs/Web/API/G...
Note: These events are not fired in Chrome, only Firefox. In Chrome you have to use Navigator.getGamepads() to access Gamepad objects.
ps
You need use navigator.getGamepads() in your update loop function
My example for browser console: