WPT details: Internal web tests: third_party/blink/web_tests/gamepad/gamepad-raw-input-change-event.html
This proposal extends the Gamepad API with a new event-driven model that enables applications to receive gamepad input with lower latency. Instead of relying on frequent polling via navigator.getGamepads(), developers can now listen for a rawgamepadinputchange event, which fires whenever new input data is available from the device. This allows for more responsive input handling, particularly in latency-sensitive applications.
The current Gamepad API relies on a polling-based model, where applications must repeatedly call navigator.getGamepads() and compare the entire gamepad state to detect changes such as button presses or axis movements. Introducing an event-driven alternative would allow applications to respond directly to meaningful input changes without relying on a polling loop. This approach not only simplifies input handling but may also help reduce average input latency.
Samples: https://gabrielsanbrito.github.io/gamepad-raw-input-events
Explainers: https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/GamepadEventDrivenInputAPI/explainer.md