Linux/GTK: add support for gamepad touchpad -> touch screen input#903
Merged
rofl0r merged 4 commits intoTASEmulators:masterfrom Apr 21, 2025
Merged
Linux/GTK: add support for gamepad touchpad -> touch screen input#903rofl0r merged 4 commits intoTASEmulators:masterfrom
rofl0r merged 4 commits intoTASEmulators:masterfrom
Conversation
rofl0r
reviewed
Apr 19, 2025
Collaborator
|
on first glance doesnt look bad. can the person that filed the original issue do a test and confirm whether it works ? i dont have the required hw to test. |
Collaborator
|
apparently the guy cant test it. do you have a touchpad device that you tested it with? |
Contributor
Author
|
I tested with ps5 dualsense touchpad. Also I'm currently trying to build gtk3 frontend for windows, all dependencies seem to be available via vcpkg, so maybe I'll be able to provide executable for him to test. Update: I give up trying to build for windows - too many problems with that. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
For this I had to somewhat rework SDL input handling and add game controller api usage: if joystick is recognized as a game controller by SDL I open it as a game controller, otherwise fallback to generic joystick open. This is required to receive touchpad events. Additionally I have to filter out joystick events if joystick is open as game controller, otherwise there will be double events.
Touchpad finger coords are translated into touchscreen coords thus making touchpad act like touchscreen. This may be what is wanted in #897, but I implemented it only for Linux GTK frontends. Cli frontend must process changes in touchpad_status structure for touchpad translation to work (just like it does for mouse_status structure).
Note that hidraw access permissions are required to use touchpad, i.e. /dev/hidraw* file corresponding to gamepad must be accessible for user.