You are not logged in.

#1 2022-07-19 09:21:52

lugge
Member
Registered: 2017-03-17
Posts: 33

Use Gamepad for Keyboard/Mouse emulation

Hi there,
I'm setting up a multi media PC for my TV.
The system will run a very basic installation. There will be no desktop environment but openbox with only a single fullscreen application at a time (e.g. VLC player, browser, messenger...)
There will be a wireless keyboard for entering text (yes, otherwise browser/youtube will not be fun).
But most of the time, I hope, the user (read: me) should be able to control the system with a gamepad or via TV remote (CEC).

What I need now is some way of using a gamepad to simulate keyboard strokes or mouse clicks.
For example: button A on gamepad is pressed, resulting in the key combo CTRL + q.
This will let me control VLC (and other apps) via gamepad.

Is there a tool or script which can do this mapping?
If not, can I use something like xdotools to simuate key strokes in an X environment?

Bonus points if one can map analog sticks on the gamepad to the mouse cursor ;-)

Offline

#2 2022-07-20 10:20:38

lugge
Member
Registered: 2017-03-17
Posts: 33

Re: Use Gamepad for Keyboard/Mouse emulation

Got a solution by writing a python script which reads /dev/input/js0, does some parsing and then calls xdotool for sending keystrokes.
Can control VLC, feh... on my TV media PC with gamepad (and soon CEC remote control I hope). Mapping analoge sticks to mouse cursor movement still in progress.

However, any out-of-the-box solution would still be appreciated.

Offline

#3 2022-08-18 18:49:01

wulax
Member
Registered: 2006-02-20
Posts: 30

Re: Use Gamepad for Keyboard/Mouse emulation

Try https://aur.archlinux.org/packages/qjoypad

I use it for mouse and key input through the bluetooth PS3 controller.

Offline

Board footer

Powered by FluxBB