Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DualSense touchpad press also detected by games as R1 press (actually mouse click) #3682

Open
2 tasks done
daniele-athome opened this issue Feb 21, 2025 · 5 comments
Open
2 tasks done

Comments

@daniele-athome
Copy link

daniele-athome commented Feb 21, 2025

Is there an existing issue for this?

  • I have searched the existing issues

Is your issue described in the documentation?

  • I have read the documentation

Is your issue present in the latest beta/pre-release?

This issue is present in the latest pre-release

Describe the Bug

In a few games, DualSense touchpad press is also detected as R1 press.

Expected Behavior

A touchpad press should only be detected as that.

Additional Context

Sunshine is running in a X11 desktop environment running XFCE, games running through Steam with Steam Input disabled. Mouse device provided by the emulated controller was disabled in XFCE Mouse settings (otherwise it would act as a mouse and that's even worse while in-game).

Tested games:

  • Horizon Forbidden West
  • Cyberpunk 2077

The R1 press is not detected by https://github.com/games-on-whales/sdl-jstest - log below. The R1 button code doesn't appear in the test (running while in-game in a ssh session) as I can see the R1 button code (when I voluntarily press it) is different from the touchpad press code.
I'm not even sure that the touchpad press is detected only as touchpad + R1 press, it might be detected also as other keys but the games I'm testing with don't show any other visible reactions.

Host Operating System

Linux

Operating System Version

Debian current testing

Architecture

amd64/x86_64

Sunshine commit or version

2025.219.141943

Package

Linux - deb

GPU Type

AMD

GPU Model

Radeon RX 6800

GPU Driver/Mesa Version

24.3.4-3

Capture Method

KMS (Linux)

Config

adapter_name = /dev/dri/renderD129
address_family = both
av1_mode = 1
channels = 2
gamepad = ds5
global_prep_cmd = [{"do":"sudo systemctl start usbip-all.target","undo":""}]
output_name = 0
sunshine_name = gaming
wan_encryption_mode = 2

Apps

Relevant log output

(log from sdl2-jstest)
Joystick Name:     'DualSense Wireless Controller'
Joystick GUID:     030057564c050000e60c000000006800
Joystick Number:    0
Number of Axes:     6
Number of Buttons: 17
Number of Hats:     0
Number of Balls:    0
GameControllerConfig:
  missing (see 'gamecontrollerdb.txt' or SDL_GAMECONTROLLERCONFIG)

Entering joystick test loop, press Ctrl-c to exit
SDL_JOYDEVICEADDED which:0
SDL_CONTROLLERDEVICEADDED which:0
Error: Unhandled event type: 1543
[...]
Error: Unhandled event type: 1622 <-- touchpad contact (I think?)
Error: Unhandled event type: 1623 <-- touchpad move
Error: Unhandled event type: 1623
Error: Unhandled event type: 1623
Error: Unhandled event type: 1623
Error: Unhandled event type: 1623
Error: Unhandled event type: 1623
Error: Unhandled event type: 1623
Error: Unhandled event type: 1623
Error: Unhandled event type: 1623
Error: Unhandled event type: 1623
Error: Unhandled event type: 1623
Error: Unhandled event type: 1623
SDL_JOYBUTTONDOWN: joystick: 0 button: 15 state: 1 <-- touchpad press button down
Error: Unhandled event type: 1623
Error: Unhandled event type: 1623
Error: Unhandled event type: 1623
Error: Unhandled event type: 1623
Error: Unhandled event type: 1623
SDL_JOYBUTTONUP: joystick: 0 button: 15 state: 0 <-- touchpad press button up
Error: Unhandled event type: 1623
Error: Unhandled event type: 1623
Error: Unhandled event type: 1623
Error: Unhandled event type: 1623
Error: Unhandled event type: 1623
Error: Unhandled event type: 1623
Error: Unhandled event type: 1623
Error: Unhandled event type: 1623
Error: Unhandled event type: 1623
Error: Unhandled event type: 1624 <-- touchpad end contact
SDL_JOYBUTTONDOWN: joystick: 0 button: 1 state: 1 <-- circle (exiting game section)
SDL_JOYBUTTONUP: joystick: 0 button: 1 state: 0 <-- circle
Error: Unhandled event type: 1622 <-- I try a few more times
Error: Unhandled event type: 1623
Error: Unhandled event type: 1623
Error: Unhandled event type: 1623
Error: Unhandled event type: 1623
Error: Unhandled event type: 1623
Error: Unhandled event type: 1623
SDL_JOYBUTTONDOWN: joystick: 0 button: 15 state: 1
Error: Unhandled event type: 1623
Error: Unhandled event type: 1623
Error: Unhandled event type: 1623
Error: Unhandled event type: 1623
Error: Unhandled event type: 1623
Error: Unhandled event type: 1623
SDL_JOYBUTTONUP: joystick: 0 button: 15 state: 0
Error: Unhandled event type: 1623
Error: Unhandled event type: 1623
Error: Unhandled event type: 1623
Error: Unhandled event type: 1623
Error: Unhandled event type: 1623
Error: Unhandled event type: 1623
Error: Unhandled event type: 1624
SDL_JOYBUTTONDOWN: joystick: 0 button: 1 state: 1
SDL_JOYBUTTONUP: joystick: 0 button: 1 state: 0
Error: Unhandled event type: 1622
SDL_JOYBUTTONDOWN: joystick: 0 button: 15 state: 1
Error: Unhandled event type: 1623
Error: Unhandled event type: 1623
Error: Unhandled event type: 1623
SDL_JOYBUTTONUP: joystick: 0 button: 15 state: 0
Error: Unhandled event type: 1623
Error: Unhandled event type: 1623
Error: Unhandled event type: 1623
Error: Unhandled event type: 1624
SDL_JOYBUTTONDOWN: joystick: 0 button: 1 state: 1
SDL_JOYBUTTONUP: joystick: 0 button: 1 state: 0
SDL_JOYBUTTONDOWN: joystick: 0 button: 10 state: 1 <-- voluntary R1 press button down
SDL_JOYBUTTONUP: joystick: 0 button: 10 state: 0  <-- voluntary R1 press button up
@daniele-athome
Copy link
Author

daniele-athome commented Feb 21, 2025

/cc'ing @ABeltramo per his request.

Actually there is also another bad key mapping concerning the little key next to the touchpad (left side) but I think I'll open another bug for that.

@ABeltramo
Copy link
Collaborator

Grazie Daniele! 😉

Quick question: is "R1" the same behaviour in-game as clicking the mouse? I have the same issue on Helldivers when using the real dualsense plugged on my desktop (using it directly, not via Moonlight): clicking the touchpad also triggers the "shooting" action, which is "clicking the mouse" action.

I also wondered if it's Moonlight that is picking up the "touchpad click" event and sending it to Sunshine, which will end up sending down that event via the mouse.

Interesting problem, I'm a bit busy at the moment, but I'll definitely look further into it!

@daniele-athome
Copy link
Author

daniele-athome commented Feb 21, 2025

Quick question: is "R1" the same behaviour in-game as clicking the mouse? I have the same issue on Helldivers when using the real dualsense plugged on my desktop (using it directly, not via Moonlight): clicking the touchpad also triggers the "shooting" action, which is "clicking the mouse" action.

Indeed, the same thing happens with normal mouse click.

Thanks for looking into this!

EDIT: possibly related moonlight-stream/moonlight-qt#1094

@daniele-athome
Copy link
Author

daniele-athome commented Feb 21, 2025

I "fixed" it by adding a udev rule (to the Moonlight host) that ignores the touchpad:

SUBSYSTEM=="input", ATTRS{name}=="*Controller Touchpad", ENV{LIBINPUT_IGNORE_DEVICE}="1"

Touchpad is no longer detected as click now and it works in game; it is also "turned into a mouse" while pressing the PS button (that's by Steam I think).

I don't know if this is the way to fix this though.

@ABeltramo
Copy link
Collaborator

Interesting!
So, clientside, I guess Moonlight was sending both the Joypad touchpad event and the click one? That's a good hint that narrows it down further. Thanks!

@daniele-athome daniele-athome changed the title DualSense touchpad press also detected by games as R1 press DualSense touchpad press also detected by games as R1 press (actually mouse click) Feb 24, 2025
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

No branches or pull requests

2 participants