window.addEventListener("gamepadconnected", Joystick.connect); window.addEventListener("gamepaddisconnected", Joystick.disconnect);var gamepad = navigator.getGamepads();GamepadList
0: undefined
1: undefined
2: undefined
3: undefined
length: 4
__proto__: GamepadListWhat is the proper way to get the gamepad state? There are two problems I'm having:
- gamepadconnected doesn't fire if a gamepad is already connected and you press a button. It only fires if you plug a device in and then press a button.
- navigator.getGamepads() doesn't seem to return expected results