I'd like to simulate gamepad button presses in linux. I'm running in an environment without the uinput
kernel module loaded. Could I just send X11 Events using XTEST?
Asked
Active
Viewed 384 times
0

patrick_corrigan
- 809
- 11
- 24
-
Why are you trying to simulate button presses? There are multiple ways to get gamepad inputs on Linux, simulating at the X11 level may or may not work based on how the application consumes them. I think it's relatively uncommon for games to consume X11 gamepad events. – nondebug Nov 17 '21 at 01:43
-
Hi @nondebug I'm running an application in a docker container that I need to simulate gamepad events for. I need to be able to programatically trigger them – patrick_corrigan Dec 03 '21 at 12:40
1 Answers
0
Does xev
show all the needed events coming from your gamepad?
You could try using xdotool
to send the events to the X server.

Piotr Henryk Dabrowski
- 702
- 5
- 13
-
I'm currently using xdotool to send keyboard events and it works really well. I'll try and capture the controller events using xev and report back. – patrick_corrigan Nov 14 '21 at 20:38