JoyKeys

Map joystick and gamepad buttons to keyboard keys, so a controller can play any game that only understands the keyboard.

Windows 10 & 11 · macOS 11.3 or newer · any Linux with Python 3 · nothing to install · runs offline

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.txt in 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

  1. Plug in your controller and download Thagobyte-JoyKeys.cmd.
  2. Double-click it. If Windows says “Windows protected your PC”, click More info → Run anyway. Windows shows this for any downloaded script.
  3. Press Enter to start, then switch to your game. Close the window to stop.

Mac

  1. Connect your controller (Xbox, PlayStation, Switch Pro or MFi) and download the file.
  2. Open Terminal (Applications → Utilities) and run:
    osascript -l JavaScript ~/Downloads/thagobyte-joykeys-mac.js
  3. 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.
  4. Press Enter to start, then switch to your game. Press Ctrl+C in Terminal to stop.

Linux

  1. Plug in your controller and download the file.
  2. In a terminal, run:
    sudo python3 ~/Downloads/thagobyte-joykeys-linux.py
    It needs sudo to create a virtual keyboard. To skip sudo from then on, run it once without sudo and it prints a one-line fix.
  3. 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…