WIP - ControllerInterface. Combine evdev devices with the same "uniq" name. #8356
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Unfortunately newer Linux drivers for DS4 (Playstation 4) controllers split the device into three separate event nodes.
On my system I get:
"Sony Interactive Entertainment Wireless Controller"
"Sony Interactive Entertainment Wireless Controller Touchpad"
"Sony Interactive Entertainment Wireless Controller Motion Sensors"
Apparently this is due to some evdev policy: "A device must not mix regular directional axes and accelerometer axes on the same event node."
Our input system does allow use of multiple devices via "All Devices" or so-called "absolute path" control expressions, but this is less than desirable especially when making use of multiple DS4s.
This PR combines evdev devices that return the same non-null unique ID (via
libevdev_get_uniq
).Mapping of raw acceleration/gyroscope inputs in PR #8352 is less horrible this way.
I'm not entirely happy with this implementation. It gets pretty ugly, especially the parts that keep the button/axis names in the same deterministic order, but there doesn't seem to be a clean way to do it as evdev enumerates devices in a seemingly random order.