v152 · gamepad · web api · dev trial
Gamepad button type attribute
A read-only type attribute on GamepadButton that classifies each button as "standard" (part of the 17-button Standard Gamepad mapping), "non-standard" (a controller-specific extension), or "trackpad" — giving applications an interoperable way to recognize buttons outside the standard set, particularly the clickable trackpad on PlayStation controllers. In developer trial in Chrome 152 on desktop and Android, behind a flag.
This feature is in developer trial in Chrome 152 on desktop and Android (the milestone=152 listing files it as “In developer trial (Behind a flag)”, verified 2026-07-29). The specification change (w3c/gamepad PR #196) is open, not merged, so the enum values and attribute semantics can still change in review. To try it:
- Launch Chrome with
--enable-blink-features=GamepadButtonTypes. The runtime featureGamepadButtonTypesis statusexperimentalin runtime_enabled_features.json5 (fetched 2026-07-29) and is notpublic: true— there is nochrome://flagsentry, so the command-line flag is the switch. - There is no origin trial for this feature (the ChromeStatus API record has
origintrial: false) — sites cannot enable it for their users; it is for local experimentation and engine feedback. - Feature-detect with
"type" in GamepadButton.prototypebefore reading the attribute (see examples) — in browsers without it, the property is simply absent, so detection is clean.
Implementation provenance: prototyped in Chromium by CL 7760763 (merged 2026-07-24, flagged); tracked as Chromium issue 339841686.
at a glance
| What it is | A new read-only attribute, GamepadButton.type, returning a GamepadButtonType enum value classifying the button's role relative to the Standard Gamepad mapping — "standard", "non-standard", or "trackpad" |
|---|---|
| Milestone listing | Chrome 152 — In developer trial (Behind a flag), desktop and Android (listing, verified 2026-07-29; the listing is authoritative per gendn invariant #2) |
| Spec change | w3c/gamepad PR #196 — “Add extended buttons to support trackpad (#191)”, open (created 2024-03-05); rendered diff at the PR preview. The base W3C Gamepad ED does not yet contain the attribute |
| Runtime feature | GamepadButtonTypes — status experimental, not public (flag record); Chromium IDL gates the member with [RuntimeEnabled=GamepadButtonTypes] (gamepad_button.idl) |
| Other engines | WebKit: WebKit PR #65693 open (“[Gamepad] Add GamepadButton.type support”), WebKit bug 266293. Gecko: the spec PR's implementation-commitment field for Mozilla is empty — no public Gecko position recorded (2026-07-29) |
| Member reference | GamepadButton.type — full nine-dimension reference |
| WPT | No dedicated upstream tests: the wpt/gamepad directory (16 files, listed 2026-07-29) has no button-type test, and the spec PR's WPT checkbox is unticked |
| ChromeStatus | 5075054393163776 — Gamepad button type attribute (blink component Blink>GamepadAPI) |
why it exists
The Gamepad API defines standard indices for 17 common buttons (the Standard Gamepad mapping), but controllers ship with many more inputs — trackpads, share/capture buttons, voice-assistant buttons, home buttons, squeeze buttons. Today, recognizing them means hardcoding per-controller button-index tables: a DualSense trackpad click is button 17 on that controller, with no interoperable signal. The motivating case is the clickable trackpad on PlayStation controllers (DualShock 4, DualSense): cloud-gaming services want to prompt “press the touchpad” without maintaining a controller database.
The explainer lists the use classes: cloud-gaming services showing controller-specific prompts, browser games adapting UI to controller capabilities, accessibility software describing inputs meaningfully, and any application identifying touchpad input on DualShock/DualSense devices. Explicit non-goals: exposing controller model identifiers, manufacturer information, vendor-specific button names, changing existing mapping behavior, or adding remapping functionality.
Source: ChromeStatus API record — summary and motivation; explainer — goals, non-goals, trackpad use case; spec PR preview §14.1 — additional gamepad buttonshow it works
The spec PR adds a §14.1 “Additional gamepad buttons” concept: an extended gamepad button mapping beyond the Standard Gamepad mapping, covering buttons commonly found on certain models — trackpads/touchpads, share or capture buttons, voice-assistant buttons, home buttons, squeeze buttons. The section is explicit that the list is not exhaustive and that user agents may expose different or additional buttons, so a Gamepad's buttons array is not limited to 17 entries.
Every button is then classified by the new attribute relative to that extended mapping:
| Value | Meaning |
|---|---|
"standard" | A button whose type is defined in the Standard Gamepad mapping (the 17 named buttons: right/left/center clusters, front buttons, stick presses) |
"non-standard" | A button that exists on the controller but has no corresponding standard button type — the controller-specific extensions |
"trackpad" | A trackpad input type — a dedicated classification because trackpads have known cross-device semantics and existing developer use cases |
The classification model deliberately distinguishes "trackpad" (known cross-device semantics) from "non-standard" (controller-specific, no standardized type). The explainer frames the three values as a starting set: future classifications would require separate specification review and Working Group consensus. The full member contract — exposure, lifecycle, edge cases — is on the GamepadButton.type member page.
syntax
The spec PR's WebIDL — a new enum plus a new attribute on the existing GamepadButton interface:
enum GamepadButtonType {
"non-standard",
"standard",
"trackpad",
};
[Exposed=Window]
interface GamepadButton {
readonly attribute boolean pressed;
readonly attribute boolean touched;
readonly attribute double value;
readonly attribute GamepadButtonType type;
};
Chromium's shipped IDL (gamepad_button.idl, fetched 2026-07-29) matches the enum and attribute exactly, annotated with the runtime gate — and its inline comments gloss the values: non-standard = “a button outside the Standard Gamepad layout with no known semantic role”, standard = “a button in the Standard Gamepad layout”, trackpad = “a clickable trackpad surface”:
[RuntimeEnabled=GamepadButtonTypes]
readonly attribute GamepadButtonType type;
Source: spec PR preview — GamepadButtonType enum and GamepadButton interface (verbatim); gamepad_button.idl (verbatim, incl. value comments)
examples
Feature detection first — the attribute is absent where unsupported, so prototype detection is clean (pattern from the explainer):
if ("type" in GamepadButton.prototype) {
// GamepadButton.type is available
}
Finding a trackpad button across connected gamepads (adapted from the explainer's trackpad example):
const gamepad = navigator.getGamepads()[0];
for (const button of gamepad.buttons) {
if (button.type === "trackpad") {
console.log("Trackpad button detected");
}
}
Splitting a controller's buttons by classification:
const standard = gamepad.buttons.filter(b => b.type === "standard");
const extras = gamepad.buttons.filter(b => b.type === "non-standard");
// e.g. render a standard-layout diagram for `standard`,
// and an "additional controls" section for `extras`
Source: snippets adapted from the explainer — examples, compatibility; showcase availability checked directly
web platform tests
No dedicated upstream WPT coverage exists for this attribute (2026-07-29): the wpt/gamepad directory lists 16 files — permissions-policy, events, rumble, timestamp, and an idlharness-manual.html — with no button-type test, and spec PR #196 leaves its “Modified Web platform tests” checkbox unticked. The Gamepad API's reliance on physical devices means much of its WPT surface is manual-only.
browser compatibility
Interim table. There is no BCD entry for the type member — BCD api/GamepadButton.json records only pressed, touched, and value (fetched 2026-07-29) — and no web-features entry (a webstatus.dev query returns zero matches). Rows below are compiled from the linked primary sources, not from BCD.
| Browser | Support | Evidence |
|---|---|---|
| Chrome | Developer trial 152 (desktop, Android), behind --enable-blink-features=GamepadButtonTypes | milestone=152 listing; Intent to Prototype (DevTrial desktop 152, Android 152); flag record |
| Edge | Not separately reported | Chromium-based; no separate position on the ChromeStatus record |
| Firefox | No public position recorded | The spec PR's implementation-commitment field for Gecko is an empty bug template (2026-07-29) |
| Safari / WebKit | Implementation in progress | WebKit PR #65693 (open, “[Gamepad] Add GamepadButton.type support”); WebKit bug 266293 (“Review in progress” per the explainer) |
security and privacy
- Read-only, no new capabilities — the attribute is a classification of an input the page can already observe through button indices and state; it adds no device access and requires no permission beyond the existing Gamepad API model (explainer: “No additional permissions are required”).
- Fingerprinting surface — the base spec's §14.2 (PR preview — fingerprinting mitigation) notes that inspecting
Gamepadcapabilities enables active fingerprinting and permits the user agent to alter exposed device information (for example, clamping button counts to the standard layout) — a mitigation that directly changes whichtypevalues a page can observe. The explainer assesses the added surface as minimal: no device, product, or manufacturer identifiers and nothing user-specific beyond what button behavior already reveals. - Permissions Policy — the Gamepad API defines the policy-controlled feature
"gamepad"(default allowlist*); where a document's policy disables it,getGamepads()andgamepadconnected/gamepaddisconnectedare blocked, so noGamepadButtonobjects (and notypevalues) are reachable at all (PR preview §20; WPT permissions-policy-gamepad.html). - Backward compatible — support detection is
"type" in GamepadButton.prototype; existing content is unaffected (explainer compatibility section).
specifications
| Document | Status |
|---|---|
| w3c/gamepad PR #196 — Add extended buttons to support trackpad (rendered preview) | Open (created 2024-03-05, updated 2025-07-10); the normative text for this feature while unmerged — ChromeStatus classifies it as a Working Draft under development in the Web Applications WG |
| W3C Gamepad (Editor's Draft) | The base specification; does not yet contain GamepadButton.type (PR unmerged, 2026-07-29) |
| Gamepad Button Type explainer (Reynolds — Google, Cáceres — Apple, Shin — NVIDIA) | Explainer; records “ChromeStatus (merged in M152)” for the Chromium prototype |
| w3c/gamepad issue #191 — Add trackpad button support | Initial public proposal, open |
see also
GamepadButton.type— member reference (this site)- Chrome Platform Status — Gamepad button type attribute (API record)
- blink-dev — Intent to Prototype: Gamepad button type attribute
- Chromium CL 7760763 — prototype (merged, flagged) · Chromium issue 339841686
- WebKit PR #65693 · WebKit bug 266293
- MDN — GamepadButton (the host interface; MDN does not document
type— the member URL 404s and search returns no matching document, 2026-07-29) · MDN — Gamepad API - Chrome Platform Showcase — feature page (demo pending; 404 at check time)