How to Play Browser Racing Games With a Controller
Browser games support controllers through the Gamepad API, which every current desktop browser implements. The catch that trips up almost everyone: the browser will not show a page your pad until you press a button on it. The API only exposes gamepads after a user gesture, so a pad that is plugged in, paired and lit up still reads as absent. Connect over USB or Bluetooth, load the page, press A. Mars Rally Championship, a free browser rally game, accepts any pad reporting at least six buttons and two axes.
Press a button first — this is the whole trick
navigator.getGamepads() returns an array as soon as you ask for it, but the slots stay empty until the browser has seen you use the device. Chrome, Edge, Firefox and Safari all gate the pad list behind that first press, so nothing is broken while you wait — the browser has not decided you are a gamepad user yet.
The reason is fingerprinting: a pad exposes an id string with vendor and product codes, a button and axis count, and sometimes a vibration actuator — enough to help identify a machine across sites. Browsers withhold it until you show intent, as MDN's guide to using the Gamepad API describes. Two rules follow from that: the tab must be focused, so a pad "stops working" when you alt-tab to a chat window, and a cross-origin iframe is gated by a permissions policy, so a game embedded on an aggregator portal may never see your pad even though it works at its own address.
Mars Rally Championship polls the pad list every rendered frame rather than trusting the gamepadconnected event, so a pad you wake mid-stage is picked up on the next frame. Where navigator.getGamepads is missing — iOS Safari up to 14 — or throws, the subsystem switches itself off and keyboard and touch carry on.
Connecting over USB and Bluetooth
Start with USB when something is wrong: a wired pad has no pairing state to go stale, and Bluetooth's small but real added latency disappears.
On Windows, Xbox controllers work over USB with no driver install. Xbox Wireless Controllers made from 2016 onward pair over Bluetooth from Settings; earlier revisions need the cable or an Xbox Wireless Adapter. A DualSense or DualShock 4 pairs by holding PS and Create/Share. On macOS, Xbox Bluetooth models and PlayStation pads pair from System Settings and arrive as ordinary gamepads.
On ChromeOS both routes work and Chrome's Gamepad API is fully present, which makes a Chromebook a better racing machine than its spec sheet suggests — the longer argument is in the guide to racing games for a Chromebook browser. On Android, Chrome supports the API, most pads pair from system settings, and USB-OTG works; phones otherwise get touch controls, covered in playing on your phone.
Standard mapping, and the pads that do not report it
The Gamepad specification defines a "standard gamepad": fixed indices for a two-stick, four-shoulder, four-face-button layout. Button 0 is the bottom face button, 4 and 5 the bumpers, 6 and 7 the triggers, 8 and 9 Back and Start, axes 0 and 1 the left stick. A browser that recognises a device remaps its raw HID report onto that layout and sets the pad's mapping property to "standard". The W3C Gamepad specification is the authority on which index is which.
Almost every modern console pad reports standard: Xbox, DualSense, DualShock 4, Switch Pro, and well-behaved third parties like 8BitDo. What does not is anything the browser has no remapping table for — arcade sticks, flight yokes, no-name USB pads, most racing wheels. Those report an empty mapping and hand you their buttons in whatever order the driver enumerated them. Mars Rally Championship reads those fixed standard indices, so a non-standard pad does something, just not what the label says. Wheels with pedals are not supported.
How to tell the page has actually seen your pad
Mars Rally Championship shows a small GP badge carrying the controller's reported name, trimmed of the vendor suffix some browsers append. If the badge is there, the pad is live and being polled. The second signal is that the on-screen control hints swap from keyboard keys to button glyphs the moment a pad connects: LS for drive, LT/RT for brake and gas, LB/RB for gear down and up, A for handbrake, B for camera, START for restart, BACK for exit. Settings stays labelled M, because no gamepad binding exists for it. If neither changes, the page has not seen the pad yet.
The full control map
| Action | Gamepad | Keyboard |
|---|---|---|
| Steer | Left stick X (analog) | ← / → |
| Throttle | RT / R2 (analog) | W or ↑ |
| Brake and regen | LT / L2 (analog) | S or ↓ |
| Handbrake | A / Cross (held) | Space |
| Cycle camera | B / Circle | C (Shift+C back) |
| Gear down | LB / L1 | Z |
| Gear up | RB / R1 | A |
| Restart the stage | Start | R |
| Exit to the site | Back / Select | Esc |
| Look left / right | — | Q / E |
| Flip recovery | — | T |
| Pause | — | P |
| Settings | — | M |
Both bindings are live at once, and the merge is deliberately dumb in the good sense: throttle, brake and handbrake take the larger of the keyboard and gamepad values, so any source overrides idle and nothing fights, while steering prefers the pad whenever the stick is off centre, then the touch track, then the arrow keys. The handbrake is read as a held button every frame; camera, gears, restart and exit are edge-detected one-shots gated by game state, so a stray thumb on Back outside a run is ignored.
What the three tuning settings actually do
Three gamepad values are adjustable and persist between sessions. Open them in-game with M, or jump straight to the settings panel.
Steer deadzone, default 0.10. Below that fraction of stick deflection, steering input is zero. Above it, the remaining travel is rescaled so output ramps from zero at the deadzone edge to full lock — no step at the boundary, which is what a naive deadzone gets wrong. Raise it if a worn stick makes the rover wander on a straight; lower it if small corrections go nowhere.
Trigger deadzone, default 0.05. The same treatment for RT and LT. Triggers rest at a small non-zero value on plenty of pads, and 5% stops a resting trigger feeding a trickle of throttle into a stationary rover — which matters here, because the repair zone only works stopped.
Steer curve, default 1.6. An exponent applied to the stick value after the deadzone: output is input raised to that power, sign preserved. 1.0 is linear. Above 1.0 the response near centre softens while full lock stays full lock, so the first third of travel steers less and small inputs get precise. That is the setting people want when they say a car feels twitchy, and it redistributes the 0.85 rad steering lock rather than shrinking it. To feel the difference, drive the tutorial — the Proving Ground's slalom and chicane make centre-feel obvious fast.
Troubleshooting
The browser does not see the controller at all
Press a face button with the game tab focused. That fixes it more often than everything else combined. Otherwise: check the pad is not still paired to a console powering it on remotely, re-seat or swap the USB cable, since charge-only cables are common, and confirm on a generic gamepad test page, the kind listing every connected pad with live readouts. On Windows, a mode-switch pad belongs in XInput, not DirectInput.
The throttle is on or off with nothing in between
Your pad is not reporting standard mapping, so its analog triggers are landing somewhere other than buttons 6 and 7 — often as extra axes, or as digital buttons that only read 0 or 1. A standard pad reports a trigger as a button with an analog value from 0 to 1, which is what the game reads. Switching a mode-switchable pad into XInput usually fixes it; failing that, keyboard throttle works alongside pad steering.
The rover drifts on a straight with the stick untouched
Stick drift — a hardware wear pattern, not a software bug. Raise the steer deadzone in small steps until the car tracks straight with your thumb off the stick, and no further: every increment is travel you lose for fine corrections.
The car is too twitchy to place accurately
Raise the steer curve exponent. Going from 1.6 to about 2.0 changes how much stick you can use before the front end bites, and costs nothing at full lock. Twitchiness that survives that is driving input, not hardware — total grip on Mars is roughly 2.6 m/s², so fast hands unload the tires. The fix is in how to get faster at rally driving games.
Where to try this
Mars Rally Championship runs at /play with no download, no install and no account, so testing a controller costs one button press. Tune the pad in settings, learn the car in the Proving Ground tutorial, and read the beginner's guide before your first timed run. On a school or work machine, the Chromebook guide covers the rest.