We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4600

Summary: Dualshock 4 touchpad press is not detectable with SDL_JoystickGetButton
Product: SDL Reporter: dexter
Component: joystickAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: enhancement    
Priority: P2 CC: flibitijibibo
Version: 2.0.9Keywords: target-2.0.10
Hardware: x86_64   
OS: Windows 10   
Attachments: Patch exposing touchpad press to the joystick button system

Description dexter 2019-04-18 00:03:55 UTC
Created attachment 3751 [details]
Patch exposing touchpad press to the joystick button system

Hello,

When using a Dualshock 4 controller (model numbers CUH-ZCT1U and CUH-ZCT2U), pressing anywhere on the center touchpad does not send an SDL_JOYBUTTONDOWN event. I have verified this with testjoystick:

Repro steps:
1. Plug in a DS4 over USB
2. Compile testjoystick and run: testjoystick.exe 0
3. Press and hold the touchpad. Observe that no lime green box appears

Expected behavior:
A lime green box appears while the touchpad is pressed.

Notes:
I've attached a patch here that works on my PC and produces the expected behavior in testjoystick, for both DS4 model numbers I listed earlier.

If I understand correctly, by exposing this as a joystick button, the gamecontroller API mapping can be modified with a change to gamecontrollerdb.txt in the future.

Thank you,
Dexter
Comment 1 Ryan C. Gordon 2019-05-19 03:53:53 UTC
Tagging a bunch of bugs with "target-2.0.10" so we have a clear list of things to address before a 2.0.10 release.

Please note that "addressing" one of these bugs might mean deciding to defer on it until after 2.0.10, or resolving it as WONTFIX, etc. This is just here to tell us we should look at it carefully, and soon.

If you have new information or feedback on this issue, this is a good time to add it to the conversation, as we're likely to be paying attention to this specific report in the next few days/weeks.

Thanks!

--ryan.
Comment 2 Sam Lantinga 2019-06-08 21:32:53 UTC
You are correct. Your patch has been added, thanks!
https://hg.libsdl.org/SDL/rev/5196f7a4d659