Controller Not Working in Browser Games: How to Fix It
If your controller is not working in a browser game, press a button on it after the page has loaded. Browsers deliberately hide a connected gamepad from a page until you touch it, so a game that loaded first sees nothing at all. If a button press doesn’t wake it, the usual causes are a game that doesn’t read controllers at all, a pad the browser doesn’t map to the standard layout, a game embedded in another site, a plain http:// page in Firefox, or Steam or a remapping tool grabbing the controller first.
I make Ridgeback, a flying game for the browser that plays with a gamepad, so I’ve spent more time than I’d like reading what browsers do and don’t pass to a page. Here’s the order I’d check things in.
1. Press a button after the page loads
This catches most people out, and it’s on purpose. The W3C Gamepad specification says getGamepads(), the call a game uses to read controllers, returns an empty list until the browser has seen a “gamepad user gesture”: you pressing a button or moving a stick. The point is privacy. A list of your connected devices helps sites fingerprint you, so the page doesn’t get it until you show you’re using one.
Two more details from the spec and MDN’s guide to the Gamepad API:
- The press only counts while the page has your attention. Click inside the game first so its tab is the focused one, then press a button.
- If the controller was already plugged in when the page loaded, the page is told about it when you press a button or move a stick, not before.
So: open the game, click on it, press A (or Cross). A well-made game shows something when it sees the pad. Ridgeback puts up a “Gamepad ready” message and a Gamepad badge on the screen.
2. Check the game actually supports a controller
The browser hands the game the raw state of every button and stick. It doesn’t turn a controller into arrow keys or a mouse, so if the game was written for keyboard only, the controller does nothing, however well it’s connected. Many browser games are keyboard-and-mouse only.
Look at the game’s controls or help screen for “gamepad” or “controller”. If it isn’t mentioned, assume it isn’t supported.
3. Test the controller on its own
To find out whether the problem is the controller, the browser or the game, open a gamepad tester in the same browser, such as Gamepad Tester or Hardware Tester’s gamepad page. Press a button and watch.
- The tester sees nothing: the browser isn’t getting the controller. Try a cable instead of Bluetooth, another USB port, or another browser. If no browser sees it, it’s a connection or driver problem in the operating system, not the browser.
- The tester sees it, the game doesn’t: the browser is fine. It’s the game, the page it’s embedded in (step 5), or focus (step 1).
- The tester shows the wrong buttons lighting up: read the next section.
4. Wrong buttons, or a stick that does the wrong thing
Browser games rely on a fixed layout. The spec defines one, the “Standard Gamepad”, where button 0 is the bottom face button (A on Xbox, Cross on PlayStation), 12 to 15 are the d-pad, axes 0 and 1 are the left stick, and so on. When the browser recognises your controller, it reorders the inputs to match and reports its mapping as "standard". When it doesn’t, mapping is an empty string, which the spec defines as “no mapping is in use”: the buttons arrive in whatever order the hardware sends them.
Most browser games assume the standard layout without checking, Ridgeback included. On an unrecognised pad that’s when jump ends up on the wrong button or a trigger reads as a stick.
The testers above show the mapping value. If it’s blank:
- Try the other connection. The same controller can report differently over USB and Bluetooth.
- Try another browser. Each one keeps its own list of controllers it knows how to map.
- Some cheap pads have a switch or button combination for an Xbox-style mode (often called XInput). Check its manual; that mode tends to be recognised.
5. The game is embedded in another site
Plenty of browser games run inside a frame on a portal or a developer page. The page around the frame decides whether the game in it may read controllers, using a Permissions Policy feature named gamepad. The spec’s default allows frames, but a site can turn it off. Mozilla also announced in 2020 that Firefox 82 would require the outer page to grant it explicitly, with allow="gamepad" on the frame.
If a game ignores your controller on one site, look for a way to open it on its own page (a fullscreen or “play on the developer’s site” link) and try there.
6. Firefox and http:// pages
Since Firefox 81, Mozilla’s same post says, the Gamepad API only works in secure contexts: pages served over https://, plus localhost. On a plain http:// page, Firefox gives the game an empty list and logs a warning in the console, so it looks exactly like no controller is plugged in. If the game has an https:// address, use that.
7. Something else has the controller
Programs that remap controllers can sit between the pad and the browser.
- Steam: Valve’s Steam Input documentation says Steam picks a controller layout according to whichever window is in front. With a browser in front, that can be a desktop layout that sends mouse and keyboard rather than a gamepad. Quit Steam completely, from its tray or menu bar icon, and test again.
- Remapping tools such as reWASD or DS4Windows: turn them off and test again. If the controller works without them, set the tool to present a virtual Xbox controller rather than keys and mouse.
Quick checklist
- Click in the game, then press a button.
- Confirm the game lists controller support.
- Open a gamepad tester in the same browser.
- If the buttons are wrong, check that
mappingreadsstandard; try the other connection or browser. - If the game is embedded, open it on its own page.
- In Firefox, use the
https://address. - Quit Steam and any remapping tool, then test again.
Trying it with Ridgeback
Ridgeback is a free cel-shaded flying game I make: you thread stone arches down a canyon and skim a river for bonus time. It was built to be played with a controller as well as a keyboard or a touchscreen, and it makes a handy test, because it tells you the moment it sees a pad. With a standard-layout controller:
- Left stick or d-pad: steer, climb and dive.
- Either trigger or shoulder button (or the left face button): boost.
- Bottom face button: barrel roll.
- Menu (Start): pause. View or Select: restart.
- On a menu, the d-pad moves the selection and the bottom face button picks it, so you can play the whole thing without touching the keyboard.
The stick has a dead zone of a quarter of its travel, so a worn stick that drifts slightly won’t steer you into a wall. Where the browser supports it, the controller rumbles on crashes, arches and pickups, each with its own pattern.
Some honest limits. Ridgeback assumes the standard layout and doesn’t let you rebind buttons, so a pad the browser reports without a mapping may have its controls in the wrong places. It reads one controller, the first one connected. Rumble depends on the browser and the controller, and it does nothing where the browser doesn’t expose it.
It’s free, needs no account and no download, and you can play Ridgeback in the browser.