A Chrome extension that emulates a gamepad using keyboard inputs. This extension allows you to play browser-based games that support the Gamepad API, such as Xbox Remote Play, without a physical gamepad.
- Emulates a standard gamepad using keyboard inputs
- Works with any web application that uses the Gamepad API
- Customizable key mappings
- Easy toggle on/off from the extension popup
- Clone or download this repository
- Open Chrome and navigate to
chrome://extensions - Enable "Developer mode" in the top right corner
- Click "Load unpacked" and select the extension directory
| Keyboard Key | Gamepad Button/Axis |
|---|---|
| Arrow Keys | D-Pad |
| Z | A Button |
| X | B Button |
| C | X Button |
| V | Y Button |
| Q | Left Bumper |
| E | Right Bumper |
| 1 | Left Trigger |
| 2 | Right Trigger |
| 3 | Start |
| 4 | Back/Select |
| Space | Home |
| W/A/S/D | Left Stick |
| I/J/K/L | Right Stick |
| Mouse Action | Gamepad Function |
|---|---|
| Mouse Movement | Right Stick Movement |
The mouse-to-right-stick mapping allows you to control the right stick by simply moving the mouse. The right stick will automatically return to center when the mouse stops moving, with a smooth decay effect.
The extension works by injecting a script into web pages that overrides the navigator.getGamepads() function to return a virtual gamepad. When you press keys on your keyboard, the extension maps those key presses to gamepad button presses.
- Click the extension icon in the Chrome toolbar
- Click "Activate Gamepad" to enable the virtual gamepad
- Use your keyboard or mouse to control the gamepad
- Click "Deactivate Gamepad" when you're done
To test the new mouse-to-right-stick feature:
- Open
mouse-test.htmlin your browser - Activate the extension
- Click and drag in the test area to control the right stick
- See
TESTING_MOUSE.mdfor detailed instructions
This extension works with any web application that uses the standard Gamepad API, including:
- Xbox Remote Play
- Google Stadia
- GeForce Now
- Any web-based game that supports gamepads
To customize the key mappings, modify the keyMappings object in gamepad-simulator.js.
- Only simulates one gamepad at a time