JoyKeys
Map joystick and gamepad buttons to keyboard keys, so a controller can play any game that only understands the keyboard.
Ready to play out of the box
Move
- D-pad → arrow keys
- Left stick → arrow keys
Buttons
- A → Space
- B and Start / Menu → Enter
- Back / Select / Options → Escape
Your own mapping
- Choose S when it starts, press a control, type a key
- Any button, stick direction, trigger or hat
- Letters, numbers, arrows, Space, Enter, Esc, Tab, Shift, Ctrl, Alt, F1–F12
- Saved in
thagobyte-joykeys.txtin your home folder
The defaults fit the games on Thagobyte Games, which use the arrow keys, Space and Enter. Some cheap or unusual controllers number their buttons differently. If a button does nothing, map it yourself with S.
How to use it
Windows
- Plug in your controller and download Thagobyte-JoyKeys.cmd.
- Double-click it. If Windows says “Windows protected your PC”, click More info → Run anyway. Windows shows this for any downloaded script.
- Press Enter to start, then switch to your game. Close the window to stop.
Mac
- Connect your controller (Xbox, PlayStation, Switch Pro or MFi) and download the file.
-
Open Terminal (Applications → Utilities) and run:
osascript -l JavaScript ~/Downloads/thagobyte-joykeys-mac.js - The first time, turn on Terminal in System Settings → Privacy & Security → Accessibility, then quit Terminal and run the command again. macOS won't let any app press keys until you allow it.
- Press Enter to start, then switch to your game. Press Ctrl+C in Terminal to stop.
Linux
- Plug in your controller and download the file.
-
In a terminal, run:
sudo python3 ~/Downloads/thagobyte-joykeys-linux.py
It needssudoto create a virtual keyboard. To skipsudofrom then on, run it once withoutsudoand it prints a one-line fix. - Press Enter to start, then switch to your game. Press Ctrl+C to stop.
Good to know
- It works with any program, including games in a browser, emulators and older PC games.
- Holding a button holds the key down. Letting go releases it.
- If the controller is unplugged, JoyKeys waits for it to come back.
- Windows supports any controller Windows recognises. Mac supports controllers that Apple's Game Controller framework supports. Linux supports any joystick the kernel recognises, on X11 or Wayland.
- Everything happens on your computer. Nothing is uploaded anywhere.
View the Windows script
A small batch launcher around PowerShell and C#. It reads the controller with Windows' built-in joystick API and types with SendInput.
Loading…
View the Mac script
JavaScript for Automation, which runs with macOS's built-in osascript. It uses Apple's Game Controller framework and posts key events through Core Graphics.
Loading…
View the Linux script
Plain Python 3 with no extra packages. It reads the controller from /dev/input and types through /dev/uinput.
Loading…