Skip to content
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.

Reenable dpad axes option #262

Merged
merged 3 commits into from
Sep 27, 2024
Merged

Conversation

DavidRGriswold
Copy link
Contributor

Closes #255 by re-enabling the Dpad Axes as an option for controllers where the buttons aren't being detected. This code already existed in an earlier version of this, I'm just adding it back, but the new code is essentially identical to the code in Lime3DS so credit to those developers.

I am still looking into why the buttons don't work even when mapped in situations where an axis is also detected (Lime3DS has this issue as well), I will try to put in a hotfix for that eventually for maximum flexibility, but in the meantime this works.

There is a cleaner solution to this that I'd like to implement eventually, but this should at least make it functional for all.

@PabloMK7
Copy link
Owner

How does the UI look after this?

I am still looking into why the buttons don't work even when mapped in situations where an axis is also detected

Can you please elaborate?

@DavidRGriswold
Copy link
Contributor Author

DavidRGriswold commented Sep 21, 2024

How does the UI look after this?

I am still looking into why the buttons don't work even when mapped in situations where an axis is also detected

Can you please elaborate?

Screenshot_20240921_103859_Citra

The bug occurs when a controller reports both axis and button values for the dpad - for example, my 8bitdo micro reports dpad up as both axis 116 and button 19. If I map only the button and not the axis, as shown in the image, then it seems to be very inconsistent in detecting the input. It works sometimes, but no always. I'm assuming that SDL is discarding one of the two inputs when it reads two inputs at once, probably to avoid double inputs when both are mapped, but it's having this somewhat unpredictable effect.

If you map both or only map axes in those cases, it seems to work. But if we only allow axis mapping then keyboards and joycons do not work.

The long term solution would be to have a single set of mappings and either map axis+ or a button to each one based on autodetection (this is how most emulators do it), but the current code structure doesn't seem to easily allow for mixing them like that, so that's a larger project. I am probably going to look into it eventually and will submit a PR both here and to Lime3DS when I get to it, but I'm not sure when that will be.

@PabloMK7
Copy link
Owner

PabloMK7 commented Sep 23, 2024

If this improves the current situation it can be accepted, but if you could add a label explaining why the inputs are listed twice for the dpad it would be better.

Something like:
"NOTE: You can map the DPAD to either buttons or axis depending on your controller behavior and design. There is no need to map both axis and buttons unless you have issues"

@DavidRGriswold
Copy link
Contributor Author

DavidRGriswold commented Sep 23, 2024

Screenshot_20240923_180902_Citra

What do you think of this?

I had to edit the HeaderSetting UI pretty deeply to do this unfortunately as it did not have an option for a description as written. I will make those edits a separate commit from the direct dpad stuff so you can cherry pick it out if you prefer.

@PabloMK7
Copy link
Owner

lgtm, thank you!

@PabloMK7 PabloMK7 merged commit f3fb038 into PabloMK7:master Sep 27, 2024
12 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

D-pad doesn't work
2 participants