EDITED at end!
Within the GameController API, is continuously polling of navigator.getGamepads() required?
I ask because my single call to this function returns a length = 0.
According to my Mac’s Bluetooth System Preferences my Nimbus+ game pad is connected.
Given that, should I use isetInterval` and wait for a length > 0?
EDIT begins here:
Macintosh with Monterey OS 12.4:
Safari (15.5) reports length = 0
Firefox (102.0b6) reports length = 0
Chrome (102.0.5005.115) reports length = 4,
but each in the array being = null
You first wait for the gamepad to be connected, which typically requires "waking" the gamepad by pressing one of its buttons:
Once the gamepad is connected, you start your game loop:
You should stop polling when the gamepad gets disconnected, which you'll be informed of via an event: