Intent to Prototype: Gamepad Event-Driven Input API

74 views
Skip to first unread message

Chromestatus

unread,
May 21, 2025, 1:16:04 PMMay 21
to blin...@chromium.org, gabrie...@microsoft.com, mattre...@chromium.org, sneha...@microsoft.com, ste...@microsoft.com

Contact emails

ste...@microsoft.com, sneha...@microsoft.com, gabrie...@microsoft.com, mattre...@chromium.org

Explainer

https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/GamepadEventDrivenInputAPI/explainer.md

Specification

None

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.



Blink component

Blink>GamepadAPI

Motivation

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.



Initial public proposal

https://github.com/w3c/gamepad/issues/4

Search tags

gamepad, button, axis, event, raw input

TAG review

None

TAG review status

Pending

Risks



Interoperability and Compatibility



Gecko: No signal Firefox’s experimental implementation, GamepadButtonEvent: https://searchfox.org/mozilla-central/source/dom/webidl/GamepadButtonEvent.webidl , GamepadAxisMoveEvent: https://searchfox.org/mozilla-central/source/dom/webidl/GamepadAxisMoveEvent.webidl#9

WebKit: No signal

Web developers: Positive (https://stackoverflow.com/questions/72294832/using-gamepad-api-via-events-rather-than-polling) 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?

None



Debuggability

N/A



Is this feature fully tested by web-platform-tests?

No

Web platform tests will be added with the prototype implementation.



Flag name on about://flags

TBD

Finch feature name

TBD

Requires code in //chrome?

True

Tracking bug

https://crbug.com/40582297

Estimated milestones

No milestones specified



Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5989275208253440?gate=5556740569956352

This intent message was generated by Chrome Platform Status.
Reply all
Reply to author
Forward
0 new messages