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

[OpenBSD] fix D-pad #3112

Closed
SDLBugzilla opened this issue Feb 11, 2021 · 0 comments
Closed

[OpenBSD] fix D-pad #3112

SDLBugzilla opened this issue Feb 11, 2021 · 0 comments

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: HG 2.0
Reported for operating system, platform: OpenBSD, x86_64

Comments on the original bug report:

On 2018-12-28 17:05:04 +0000, Thomas Frohwein wrote:

Created attachment 3555
diff to implement dpad for gamepads on OpenBSD

Hi,

If a gamepad lists the Dpad as 4 buttons (Dpad Up,Down, Left, Right) like with the Xbox 360 gamepad / XInput report descriptor used by OpenBSD (https://github.com/openbsd/src/blob/master/sys/dev/usb/uhid_rdesc.h#L184), this is not recognized by the SDL BSD backend and no hat or any other listing for the D-pad exists, e.g. in sdl2-jstest (https://gitlab.com/sdl-jstest/sdl-jstest).

The attached diff fixes this and makes the D-pad on my Xbox 360 and Logitech F310 controllers usable. It adds a hat to nhats when usage HUG_DPAD_UP is found, reads the state of the D-pad buttons into array dpad[], and turns the value of dpad[] into an SDL hat direction (dpad_to_sdl()).

Tested and works with Xbox 360 controller and Logitech F310 in XInput mode. Software-side tested with sdl2-jstest and Owlboy where this worked without problems or regressions.

I don't know if this would be applicable to other *BSDs and don't have an install to test it with, therefore wrapped it in OpenBSD ifdefs.

Thanks,

thfr

On 2019-05-18 18:48:55 +0000, Ryan C. Gordon wrote:

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.

On 2019-05-19 18:56:42 +0000, Sam Lantinga wrote:

Patch added, thanks!
https://hg.libsdl.org/SDL/rev/64dabb27041d

On 2019-06-23 02:21:12 +0000, wrote:

Hi, this patch breaks dpad/hat input on my PS4 controller. The attached patch restores functionality. Calling SDL_PrivateJoystickHat() at the end of BSD_JoystickUpdate was setting the hat state to zero on every kind of input, instead of just the HUG_DPAD events.

On 2019-06-23 02:22:44 +0000, wrote:

Created attachment 3840
Fix logic of dpad events

On 2019-06-23 04:42:11 +0000, Thomas Frohwein wrote:

(In reply to daniel.c.sinclair from comment # 4)

Created attachment 3840 [details]
Fix logic of dpad events

Thanks for reporting this unintended regression! Tested your diff with the Xbox 360 controller and it still works. While I can't reproduce the breakage and fix with the gamepads that I possess, this diff has my endorsement over the original one given that it reportedly fixes at least the PS4 controller, maybe others too...

On 2019-07-01 05:48:35 +0000, Sam Lantinga wrote:

Patch added, thanks!
https://hg.libsdl.org/SDL/rev/0c19a7239a95

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

1 participant