v147 · web api · in developer trial
Gamepad Event-Driven Input API
An extension to the Gamepad API that fires a gamepadrawinputchanged event (named rawgamepadinputchange in the ChromeStatus summary — see Syntax) whenever new input data arrives from the device, eliminating the need to poll navigator.getGamepads() on every animation frame. Reduces input latency for games and interactive applications that care about sub-frame responsiveness.
chrome://flags/#enable-experimental-web-platform-features to test it (the Blink runtime feature GamepadRawInputChangeEvent has status experimental in the Chrome 147 branch’s runtime_enabled_features.json5, so launching Chrome with --enable-blink-features=GamepadRawInputChangeEvent also enables it). The event name and interface shape may change before shipping.
at a glance
| Status in Chrome 147 | In developer trial (behind a flag) |
|---|---|
| Flag | chrome://flags/#enable-experimental-web-platform-features |
| New event | gamepadrawinputchanged on window (a GamepadRawInputChangeEvent; the ChromeStatus summary calls it rawgamepadinputchange, but the Chrome 147 branch event-name table registers gamepadrawinputchanged) |
| Standards position | Firefox: No signal (experimental implementation exists) · Safari: No signal |
| Spec | W3C Gamepad spec (working draft) — does not yet define this event; proposal in the MSEdgeExplainers explainer |
| Chromium bug | crbug.com/40582297 |
| Demo | gabrielsanbrito.github.io/gamepad-raw-input-events |
| ChromeStatus | 5989275208253440 — Gamepad Event-Driven Input API |
Evidence divergence, both sides reported rather than resolved (fetched 2026-10-06): this page originally attributed the
rawgamepadinputchange event to the W3C Gamepad specification, but I fetched that specification and the
name does not occur in it at all — it defines gamepadconnected and
gamepaddisconnected and notes future gamepadchanged/gamepadaxischanged
events. The name comes from the ChromeStatus record and from an Edge explainer this page does not link. On status,
this page records “In developer trial (behind a flag)” in Chrome 147 and names
chrome://flags/#enable-experimental-web-platform-features, while ChromeStatus feature
5989275208253440 reads “In development” with intent stage “Start incubating”,
no desktop milestone at all, and flag #gamepad-raw-input-change-event.
Event-name update (fetched 2026-11-22): the Edge explainer names the event gamepadrawinputchanged, and so does Chromium itself — the Chrome 147 branch (7727) lists gamepadrawinputchanged in its event_type_names.json5 and declares the handler ongamepadrawinputchanged in window_gamepad.idl. This page’s examples now use that name. The ChromeStatus summary still says rawgamepadinputchange; a listener for that string never fires in Chrome.
why it exists
The existing Gamepad API requires polling: you call navigator.getGamepads() inside a requestAnimationFrame loop, which runs at most at the display refresh rate (typically 60 Hz). A gamepad can report input at 1000 Hz or higher. The gap means input events can be 1–16 ms stale before the application sees them — unacceptable in competitive games or precision controllers. An event-driven model fires immediately when the hardware reports new data, independently of the frame rate, enabling applications to respond at the device's native rate.
Syntax
No W3C specification text defines this event yet. The first block shows the two ways to listen; the IDL blocks after it are quoted verbatim from Chromium’s Chrome 147 branch (7727) source; it matches the “proposed WebIDL” appendix of the explainer except for Chromium’s RuntimeEnabled extended attribute (license header omitted).
window.addEventListener("gamepadrawinputchanged", (event) => { /* GamepadRawInputChangeEvent */ });
window.ongamepadrawinputchanged = (event) => { /* … */ };
GamepadRawInputChangeEvent interface
[
Exposed=Window,
RuntimeEnabled=GamepadRawInputChangeEvent
] interface GamepadRawInputChangeEvent : GamepadEvent {
constructor(DOMString type, optional GamepadRawInputChangeEventInit eventInitDict = {});
readonly attribute FrozenArray<long> axesChanged;
readonly attribute FrozenArray<long> buttonsValueChanged;
readonly attribute FrozenArray<long> buttonsPressed;
readonly attribute FrozenArray<long> buttonsReleased;
readonly attribute FrozenArray<long> touchesChanged;
};
It inherits gamepad (the Gamepad snapshot) from GamepadEvent. The five arrays hold indices into the snapshot’s axes, buttons and touches arrays, per the explainer’s event properties:
| Attribute | Indices of… |
|---|---|
axesChanged | axes whose value changed since the last event |
buttonsValueChanged | buttons whose value changed |
buttonsPressed | buttons that transitioned to pressed |
buttonsReleased | buttons that transitioned to released |
touchesChanged | entries of gamepad.touches whose position or presence changed |
The constructor takes a GamepadRawInputChangeEventInit dictionary; constructing the event yourself (for example in tests) does not involve hardware and dispatches nothing until you call dispatchEvent().
GamepadRawInputChangeEventInit dictionary
dictionary GamepadRawInputChangeEventInit : GamepadEventInit {
FrozenArray<long> axesChanged;
FrozenArray<long> buttonsValueChanged;
FrozenArray<long> buttonsPressed;
FrozenArray<long> buttonsReleased;
FrozenArray<long> touchesChanged;
};
Event handler
// window_gamepad.idl (excerpt)
[RuntimeEnabled=GamepadRawInputChangeEvent] attribute EventHandler ongamepadrawinputchanged;
Feature-detect with "ongamepadrawinputchanged" in window or "GamepadRawInputChangeEvent" in window; both are absent unless the runtime feature is enabled.
Security and privacy
The explainer’s considerations section states that a gamepad user gesture (for example a button press) is required before gamepadrawinputchanged events start firing, and that the event exposes no state not already exposed by polling.
shape of the API
One new event on window that fires for every hardware input report:
gamepadrawinputchanged event
| Target | window |
|---|---|
| Fires when | The gamepad hardware reports new button or axis data, at the device's native polling rate — independent of requestAnimationFrame. |
event.gamepad | A snapshot Gamepad object with the current button and axis state at the time of the report. |
event.gamepad.index | Index matching the existing navigator.getGamepads() array. |
event.gamepad.buttons | Array of GamepadButton objects with pressed, touched, and value. |
event.gamepad.axes | Array of axis values in the range [-1, 1]. |
event.gamepad.timestamp | High-resolution timestamp of the hardware report. |
event.axesChanged … event.touchesChanged | Index arrays naming exactly which inputs changed — see the GamepadRawInputChangeEvent interface. |
Examples
Live demo from the chrome-platform-showcase — Gamepad Event-Driven Input API (feature index, five concepts). The embed below is its Button Visualizer concept: connect a gamepad and press a button; without a gamepad it shows its connect prompt. It needs a physical controller, so on most phones it can only show that prompt.
rawgamepadinputchange with a polling fallback; given the event name above, expect the polling path in Chrome.Source: chrome-platform-showcase — gamepad-event-driven-input-apiEvent-driven input loop (replaces polling)
// Previously: polling inside rAF
function pollLoop() {
const gamepads = navigator.getGamepads();
if (gamepads[0]) {
handleInput(gamepads[0]);
}
requestAnimationFrame(pollLoop);
}
// With gamepadrawinputchanged: fires at device rate, not frame rate
if ('ongamepadrawinputchanged' in window) {
window.addEventListener('gamepadrawinputchanged', (event) => {
handleInput(event.gamepad);
});
} else {
requestAnimationFrame(pollLoop); // fallback: keep polling
}
Low-latency button handler
window.addEventListener('gamepadrawinputchanged', (event) => {
const { gamepad } = event;
// Only look at what changed (indices into gamepad.buttons / gamepad.axes)
for (const i of event.buttonsPressed) console.log(`button ${i} pressed`);
for (const i of event.buttonsReleased) console.log(`button ${i} released`);
// A button (index 0) — fire at native device rate
if (gamepad.buttons[0].pressed) {
triggerAction(gamepad.index, 'A', gamepad.timestamp);
}
// Left stick X axis
const leftX = gamepad.axes[0];
if (Math.abs(leftX) > 0.1) {
moveCharacter(leftX);
}
});
Source: W3C Gamepad API spec and feature summary, May 2026; event name and index arrays per Chromium’s IDL and the explainer code sample (2026-11-22).
relation to the existing Gamepad API
Polling model (navigator.getGamepads()) | Still works. Returns snapshot at rAF rate. Good for most games; no changes needed. |
|---|---|
gamepadrawinputchanged events | Fires at hardware rate. Use when latency or missed inputs at sub-frame granularity matter. |
gamepadconnected / gamepaddisconnected | Unchanged. Still the mechanism for detecting connect/disconnect. |
Browser compatibility
BCD has no entry yet: neither api/GamepadRawInputChangeEvent.json (HTTP 404 on 2026-11-22) nor a gamepadrawinputchanged_event key in api/Window.json exists. The table below is interim data from the ChromeStatus record and the Chromium source, labelled as such.
| Browser | Version | Notes |
|---|---|---|
| Chrome | 147 (flag) | Runtime feature status: "experimental" on the 147 branch: behind chrome://flags/#enable-experimental-web-platform-features. ChromeStatus: DevTrial stage desktop/Android 147; origin-trial stage desktop 149–154; browser status “In development”. |
| Edge | Unknown | Chromium-based, and Microsoft authored the explainer, but no Edge-specific ship data is recorded anywhere we could verify. |
| Firefox | No support | Standards position “No signal” (ChromeStatus). The explainer notes Firefox once prototyped separate GamepadAxisMoveEvent/GamepadButtonEvent interfaces; that is not this event. |
| Safari | No support | Standards position “No signal” (ChromeStatus). |
Specifications
| Specification | Status |
|---|---|
| Gamepad Event-Driven Input API explainer (MSEdgeExplainers) | Proposal; contains the proposed WebIDL |
| Gamepad (W3C editor’s draft) | Defines Gamepad and GamepadEvent; does not define this event yet |
see also
- chromestatus — Gamepad Event-Driven Input API (5989275208253440)
- W3C Gamepad spec (working draft)
- Chromium bug — crbug.com/40582297
- Live demo: gamepad raw input events
- w3c/gamepad issue #4 — long-running request for gamepad events
- chrome-platform-showcase: Gamepad Event-Driven Input API demos
- Gamepad Event-Driven Input API explainer (MSEdgeExplainers)