This proposal adds input events for gamepad button and axis inputs.

Motivation

The current polling-based model for Gamepad API inputs requires applications to repeatedly fetch and compare the full gamepad state in order to detect button presses and axis movements. Providing an alternative event-based model allows applications to remove the polling loop and only respond to relevant events. Applications switching from polling to events may also see a reduction in average input latency.

Documentation

Specification

Specification link


Specification currently under development in a Working Group

Status in Chromium

Blink>GamepadAPI


In development (tracking bug)

Consensus & Standardization

After a feature ships in Chrome, the values listed here are not guaranteed to be up to date.

Owners

Intent to Prototype url

Intent to Prototype thread

Comments

Gamepad button and axis events are implemented in Firefox behind the flag dom.gamepad.non_standard_events.enabled. https://dxr.mozilla.org/mozilla-central/source/dom/webidl/GamepadAxisMoveEvent.webidl https://dxr.mozilla.org/mozilla-central/source/dom/webidl/GamepadButtonEvent.webidl There is also a polyfill that provides these events on browsers that do not support them. https://github.com/MozillaReality/gamepad-plus/blob/master/README.md

Search tags

gamepad, button, axis, event,

Last updated on 2021-09-23