Controller emulator for Linux devices (because it only uses Linux stuffs)
Find a file
2025-04-15 10:51:37 -07:00
Keyboard-To-Controller.cpp codeberg copy 2025-04-15 10:51:37 -07:00
keys.h codeberg copy 2025-04-15 10:51:37 -07:00
LICENSE.md codeberg copy 2025-04-15 10:51:37 -07:00
README.md codeberg copy 2025-04-15 10:51:37 -07:00

Controller Emulator For Linux

Big thank you to CommanderRag for providing the base script for this emulator: https://github.com/CommanderRag/xbox-controller-emulator-linux

How to set it up.

  1. Select the correct .cpp file that you want to use (each has a different control scheme (coming soon)).
  2. From there, you would want to get into the command line. Here are the commands to use:
cat /proc/bus/input/devices
  1. Find the "event" your keyboard uses, and put that in the .cpp file (should say something like: "PATH_HERE")
  2. Almost done! Finally, put that bad boy into a .cpp compiler! I use clang++ (part of clang).
  3. Run the command in terminal.
  4. Free controller emulator for linux.

Controls (Keyboard-to-Controller)

Keyboard Button Controller Button
Tab Top Face Button (Y)
X Left Face Button (X)
Space Bar Bottom Face Button (A)
Left Alt Right Face Button (B)
W Left Stick Up
A Left Stick Left
S Left Stick Down
D Left Stick Right
I Right Stick Up
J Right Stick Left
K Right Stick Down
L Right Stick Right
Left Shift Click In Left Stick
Right Shift Click In Right Stick
G D-Pad Up
V D-Pad Left
B D-Pad Down
N D-Pad Right
F Left Bumper (LT)
H Right Bumper (RT)
R Left Trigger (LT2)
Y Right Trigger (RT2)
F1 Select Button
F2 Start Button
F3 Mode Button (extra)
Numpad Enter Quit Application