Grumbel/xboxdrv — pull request #101 by rhn (2014-09-23 18:39:08+00:00)
Title: Better evdev mappings - reverse mode (controller emulated with real kb)

Hi!
This is a patch that extends evdev event mappings to allow absolute axes and multiple buttons.

With theis change, it's possible to have a working virtual controller from a real keyboard, for games that don't support keyboard input (e.g. Monaco when in multiplayer split-screen).

I wasn't sure whether to file this as a pull request - you could argue that it's not very clean. It's intended more as "this might be something useful".

There's a new class UIAction that takes over button mappings, and translates button press events to multiple buttons and absolute events on the evdev level.
I think some functionality is doubled with --ui-buttonmap portion, and it would be an awesome next step to make --ui-buttonmap could map from evdev events directly. It would be especially useful to prevent glitches with releasing buttons.

The change. break evdev config files. Sample evdev config:

[evdev-keymap]
KEY_SEMICOLON=BTN_B
KEY_R=BTN_start
KEY_S=BTN_du+BTN_dl # will press/unpress 2 buttons
KEY_UP=ABS_Y1:10000:0 # on press will send axis event with value 10000, on release will reset axis to 0
KEY_DOWN=ABS_Y1:-10000 # same, but will not release axis