philipl / evdevremapkeys

Daemon to remap events on linux input devices
MIT License
131 stars 40 forks source link

Emulate Xbox 360 gamepad #21

Open dariox86 opened 4 years ago

dariox86 commented 4 years ago

Button mapping of most modern video games default to the Xbox 360 gamepad. There are several tools to remap my PlayStation 2 controller to a virtual Xbox 360 gamepad, the most popular being Xboxdrv. Unfortunately it seems these tools are not maintained anymore. Your application would gracely fill the gap if not for some missing feature:

The new "range" parameter would automagically be used to convert an EV_KEY event to a EV_ABS one as well. This is needed because the Xbox 360 gamepad has some pressure-sensitive buttons with 8 bit precision that need to be mapped from the ordinary buttons on the PlayStation 2 gamepad, thus the EV_KEY event with value 1 (button pressed) would be translated to an EV_ABS event with value 255 (button fully pressed). Releasing the button would report an EV_ABS value to 0 again ("range: [255, 0]").

I think that the proposed enhancement should be very easy and elegant to implement. I would have done it myself but since I don't speak Python I find the code very hard to understand. With the proposed implementation the configuration file would look something like this:

devices:

DanielJoyce commented 4 years ago

This is getting into SC-Controller type stuff, but that project has gotten big and super hairy, and outdated ( not ported to Python 3 yet ).

dariox86 commented 4 years ago

Unfortunately there is no tool out there to fill the gap. They are either unmaintained or dependent upon older technologies.

DanielJoyce commented 4 years ago

Yeah, I'd like something 'simple' and then expand it further as needed. The core right now is simple. We could then add a module to support 'gamepads', and another to support mapping tablets. And finally a UI to help with mapping ( though nothing so fancy as showing a controller at first, more like "Press a button, how do you want it mapped?" )

dariox86 commented 4 years ago

Minimalism in computing to me is paramount. Despite the long report, implementing those features should be pretty straightforward.