Description
About Controller Mapping Test
Introduction
The DeviceHub Controller Mapping Test is a free online Gamepad layout inspector that compares Standard Gamepad labels with raw button and axis indices as your browser reports them. Developers wiring HTML5 controls, technicians facing swapped A/B on clones, flight-sim users with HOTAS boxes, and support agents explaining why a browser game “has the wrong buttons” use this page to see the truth underneath pretty silkscreens. Open the tool, wake the pad, and press each physical control while watching labeled slots and numeric indices light together. When mapping equals "standard," indices should roughly follow the W3C Standard Gamepad layout, but firmware quirks still shuffle shoulders or omit Home. When mapping is blank or "standard" is a lie from a clone, raw indices become the only reliable binding target. DeviceHub emphasizes honesty: the Gamepad API only reports what the browser and OS expose, and mapping may differ for non-standard pads. This page does not remapping your OS; it visualizes the live descriptor. Because it needs no install, classroom coding labs can teach Standard Gamepad concepts on real hardware. Indie devs capture screenshots of id strings for compatibility matrices. Parents confused by Nintendo versus Xbox face-button colors get a neutral index view instead of brand arguments.
What this tool does
The UI lists the active Gamepad’s id, index, mapping, button count, and axis count, then mirrors Standard labels (A/B/X/Y, LB/RB, LT/RT, Select/Start, sticks, D-pad) beside raw button[i] and axes[j] readouts that update live. Pressing a physical switch highlights whichever indices the OS delivered, sometimes not the label you expected. Axis sweeps show which floats move for left stick, right stick, and triggers-as-axes. Guidance explains that browser games should bind defensively when mapping is non-standard. Reset clears highlight sticky state after focus quirks. Pair with Gamepad Test for simpler smoke coverage, Joystick and Trigger tests for analog-focused views, and Calibration Test for rest/extreme capture. The mapping string is especially valuable in bug reports: “id contains ‘Vendor’, mapping='', button 0 is physical A” beats vague “controls are wrong.” Multiple connected pads are selectable so you do not annotate the wrong device. This is a diagnostic mirror, not Steam Input’s remapping UI.
When to use it
Use Mapping Test whenever face buttons feel permuted, when a web game’s prompts disagree with your pad, after buying a generic USB clone, when integrating the Gamepad API into your own site, and when Trigger or Joystick plots seem attached to the wrong physical control. Prefer Gamepad Test for a friendlier button map once you already trust indices, and Calibration Test when documenting drift numbers rather than layout. Run it after installing remappers, Steam Input often forces a Standard virtual pad that differs from the hardware-only path. Esports orgs standardizing browser-based warm-up tools should record mapping strings per pad SKU. Teachers demonstrating HID concepts can show students that “A” is an index agreement, not a universal physical law. After firmware updates that claim “better PC compatibility,” re-check whether mapping flipped to standard. Fight sticks with custom SOCD boards may report unusual button counts, document that before filing game bugs. Accessibility users remapping controls in OS utilities should verify which indices the browser still receives after those remaps. QA writing automated Gamepad fixtures can capture id substrings and button counts as allow-list data. After KVM or dock changes, re-inspect, some paths re-enumerate pads with different id suffixes that break brittle string matches in games.
How it works
navigator.getGamepads() returns Gamepad objects with buttons[], axes[], id, index, mapping, and timestamp. The Standard Gamepad specification assigns semantic roles to fixed indices; browsers set mapping to "standard" when they believe the device complies. DeviceHub renders both the semantic guess and the raw arrays so mismatches are obvious. Non-standard devices still enumerate; you cannot assume index 0 is A. Some OS drivers expose hats as axes or as four buttons; both patterns appear here. No permission prompt is required. Safari and mobile engines may omit devices or provide sparse axis lists, note the client in your matrix. Remappers change id strings and can synthesize standard layouts; test with remappers off when characterizing bare metal. HTTPS is used site-wide; gamepad reads need no getUserMedia. All inspection stays local. Timestamp fields advance as reports arrive but are not USB analyzer proofs. Button.value for triggers may be analog even under standard mapping, correlate with Trigger Test. Axis order differences between Chrome and Firefox on the same clone are possible; capture both if you ship a cross-browser game. The Gamepad API only reports what the browser and OS expose, DeviceHub will not invent missing buttons to match a silkscreen. When mapping is empty, treat Standard labels as hints only and bind gameplay to the indices you observed while pressing. Multiple simultaneous pads each occupy a slot index; always confirm which slot updates as you press before copying numbers into code.
Step-by-step instructions
- Open Controller Mapping Test over HTTPS, connect the pad, press a button to wake it, and confirm the id, mapping, button count, and axis count fields populate for the intended device.
- Press each face button slowly, writing down which Standard label lights versus which raw button index actually changes, especially important on Nintendo-layout and generic clones.
- Click sticks, bumpers, menu keys, and D-pad directions the same way, noting any physical control that never toggles an index or that toggles two at once.
- Move sticks and squeeze triggers while watching the axes table to see which floats respond; record trigger-as-axis cases for your binding code or support ticket.
- If you use Steam Input or vendor remappers, toggle them off and repeat once so you know whether the Standard layout is hardware-native or virtualized.
- Close the tab when your notes are complete, no permission revoke is needed because the Gamepad API requested none.
Common problems
Label mismatches on clones are expected, not site bugs. Empty mapping strings mean bind by index. Remappers hide true hardware topology. Hats appearing as axes confuse users expecting four D-pad buttons, both are valid HID patterns. Mobile Safari gaps limit testing. Two pads connected can make you annotate the idle device, watch which row updates. If Gamepad Test highlights “A” but raw index differs here, you are seeing the same event through different UI metaphors, trust the index for code. Drivers that expose twenty buttons for a six-button stick pad unused slots; ignore forever-zero indices. Bluetooth versus USB can change id strings slightly; record connection mode. Remote desktop may scramble indices; map on a local machine for development baselines. Nintendo-layout face colors versus Xbox prompts cause endless support threads, show users the raw index table instead of arguing brand names. If axes move while bumpers are pressed, you may be on a device that mirrors digital shoulders oddly; note it rather than assuming the page double-counted.
Privacy explanation
Mapping inspection stays in your browser session. DeviceHub does not upload controller id strings, button maps, or axis dumps to a server. No microphone or camera permission is requested. Closing the tab clears highlights. Shared classrooms can use the page for teaching when students only press test controls. Private windows help isolate remapper overlays. When filing public bug reports, consider redacting overly specific serial-like id fragments if your threat model cares, though most gamepad ids are model strings rather than unique serials. Nothing continues polling after you leave. Clearing cookies does not revoke gamepad access because none was granted through the Permissions API for this tool.