Skip to content

Linux/GTK: add support for gamepad touchpad -> touch screen input#903

Merged
rofl0r merged 4 commits intoTASEmulators:masterfrom
thesourcehim:gamepad_touchpad
Apr 21, 2025
Merged

Linux/GTK: add support for gamepad touchpad -> touch screen input#903
rofl0r merged 4 commits intoTASEmulators:masterfrom
thesourcehim:gamepad_touchpad

Conversation

@thesourcehim
Copy link
Contributor

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.

@rofl0r
Copy link
Collaborator

rofl0r commented Apr 19, 2025

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.

@rofl0r
Copy link
Collaborator

rofl0r commented Apr 20, 2025

apparently the guy cant test it. do you have a touchpad device that you tested it with?

@thesourcehim
Copy link
Contributor Author

thesourcehim commented Apr 21, 2025

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.

@rofl0r rofl0r merged commit 8a26c97 into TASEmulators:master Apr 21, 2025
9 checks passed
@thesourcehim thesourcehim deleted the gamepad_touchpad branch April 21, 2025 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants