Intent to Implement: Gamepad Button and Axis Events

50 views
Skip to first unread message

Matt Reynolds

unread,
Jun 28, 2018, 8:45:29 PM6/28/18
to 'Joe Medley' via blink-dev
mattre...@chromium.org https://docs.google.com/document/d/1rnQ1gU0iwPXbO7OvKS6KO9gyfpSdSQvKhK9_OkzUuKE Adds gamepad input events for gamepadbuttondown, gamepadbuttonup, gamepadbuttonchange, and gamepadaxismove. To consume gamepad button and axis input through the Gamepad API, applications must periodically fetch the latest gamepad data by calling navigator.getGamepads(). There are some issues with this approach. A polling-only interface means that applications that aim to achieve low input latency are required to poll at least as quickly as the browser's internal polling rate, which is not exposed through the API and may vary between browser vendors. It also means that some inputs may be lost if the tab fails to poll at the correct time. Introducing events for gamepad inputs would relieve the burden of input polling from the page and allow it to be notified when inputs are received outside the normal polling loop. For some applications it could eliminate the need for a polling loop altogether.

Discussion on the W3C Gamepad github:

Discussion on public-webapps list:
https://lists.w3.org/Archives/Public/public-webapps/2012AprJun/0469.html

Firefox: Shipped (behind dom.gamepad.non_standard_events.enabled) Edge: No public signals Safari: No public signals Web developers: Positive

There are minor differences between the proposed API change and the API as implemented in Firefox. However, it is unlikely that any applications rely on these non-standard events, and the differences are minor enough that they are compatible for most applications. None Yes
http://crbug.com/857208 https://www.chromestatus.com/features/5989275208253440 No

Reply all
Reply to author
Forward
0 new messages