Contact emails
Explainer
Specification
Summary
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.
As a side note, currently, Chromium's backend implementation for obtaining gamepad input data from the underlying platform uses a poll-based approach. Adopting a full event-based backend implementation is challenging due to platform/device support. However,
as platform support evolves, this new event API allows us to adopt an event-based approach in the backend without changing the web API shape.
Blink component
Web Feature ID
No information provided
Search tags
TAG review
None
TAG review status
Pending
Goals for experimentation
The OT should help us collect information on the performance impact of this change across real users. There is a high chance that the current API shape is NOT its final form (see more at
https://github.com/w3c/gamepad/issues/4). We want to measure whether this version of raw events brings measurable performance improvements for cloud gaming, considering many different devices. If it negatively impacts low-powered devices, we'll need to
work with partners on improvements. It could be adding event coalescing, changing the spec proposal to permit event throttling, etc.
Risks
Interoperability and Compatibility
Firefox’s experimental implementation:
There is strong developer interest in an event-driven Gamepad API to improve responsiveness and simplify input handling. In w3c/gamepad#4 (https://github.com/w3c/gamepad/issues/4),
developers have long requested events for gamepad input, citing the inefficiency of polling-based models. Similarly, in a popular Stack Overflow thread, developers express frustration with the lack of native gamepad events and seek workarounds, underscoring
unmet needs in the current API. The existence of third-party libraries like gamecontroller.js (https://github.com/firsching/gamecontroller.js)
and Gamepad-Controller (https://github.com/alvaromontoro/gamepad-controller)
further demonstrates this.
Other signals:
WebView application risks
Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?
No changes were anticipated.
Ongoing technical constraints
No information provided
Debuggability
N/A
Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, ChromeOS, Android, and Android WebView)?
Yes
No
Web platform tests will be added with the prototype implementation.
Flag name on about://flags
#gamepad-raw-input-change-event
Finch feature name
GamepadRawInputChangeEvent
Requires code in //chrome?
True
Tracking bug
Estimated milestones
|
DevTrial on desktop
|
147
|
|
DevTrial on Android
|
147
|
Link to entry on the Chrome Platform Status
Links to previous Intent discussions