-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
[3.2] Provide support for buttons and D-pads mapped to half axes. #42800
Conversation
Thank you @madmiraal for this work. I did try the build with my 2in1 Controller and it didn't actually change anything of the current 3.2.3 build. |
@salvob41 Thank you for testing. The picture provides really useful feedback. If you don't mind, please provide similar pictures for pressing each of the other directions on the D-pad. Also, please provide pictures after releasing each of the direction buttons; so I can see what happens when they are supposed to be resetting. |
the pencil in the picture is to give a nice little "arty" touch ... |
ec9e642
to
3f86387
Compare
I've updated this PR to include two new fixes:
@salvob41 Please test it again. |
3f86387
to
4beab40
Compare
@salvob41 Thanks for all the testing and images. You're my eyes with this one. I think I've fixed the negative axis (i.e up and left) to button mapping; so hopefully it will work now. Please try again. |
glad to help, @madmiraal. Thanks for your patience and work. Dpad still gives problems. I put some testing video here: |
4beab40
to
2410392
Compare
Marked as draft, because I've added a debug warning message in the axis to button mapping process. Hopefully this will provide the information needed to work out what is going wrong. @salvob41 Please test again, moving left, right, up and then down, and post the output console messages. |
Good idea putting some debug message. At the start:
Nothing happens when I press RIGHT and DOWN buttons. when I press and release the UP button (this debug print happens at the act of releasing the button)
similar with LEFT button:
|
2410392
to
58bd724
Compare
fb3ebe6
to
8ec1bfc
Compare
it seems that the last buld works good!! I will test it better in a few minutes |
I've added a fix for the mapping not taking into account that an axis range may be only positive even if it represents negative values, and removed the debug message. |
Yeahh! I tested it with my controllers and I confirm that this work! Congratulation @madmiraal on your work, perseverance and patience. |
But there is a problem @madmiraal . If I use the In 3.2.2 it gives me values between 0 and 1 |
The controller's mapping takes D-Pad hat events and maps them to axis events. Hat events only contain a direction, not a magnitude, so they can only be mapped to 0 or 1. In 3.2.2 the mapping wasn't supported; so there was no mapping: axis0 events were simply treated as left x-axis events and axis1 events were simply treated as left y-axis events. I think the mapping is odd. It maps axis events to hat events and visa-versa. This is always going to result in this lost information. If you think the mapping is wrong, then it needs to be updated upstream: https://github.com/gabomdq/SDL_GameControllerDB. |
Yes.... I am diving into the mapping and there is something weird. I tried it on a Linux and it recognised the joypad as PS3 controller. Will try to see what is wrong with the mapping |
So I put this mapping:
and the analogic works. I only see that when I press the Dpad (it works well) but the buttons seems to be held pressed. |
Are you saying that when you release the D-pad, the buttons (12, 13, 14 and 15) are remaining pressed? |
Yes |
@salvob41 I'm confused. Please provide one of your videos with what you're seeing now. |
@madmiraal Sorry for the confusion. Here's a video: Dpad button works great, but seems the are kept pressed (weird). Analogic works well (you can see it even shows the strength) |
8ec1bfc
to
7743bd0
Compare
I think I've fixed the bug that was causing the D-Pad buttons to stick. @salvob41 If you don't mind, please test it again. |
@madmiraal Something added recently on 3.2 doesn't make me build from source. I receive this error message:
I should open a issue, but I cannot test it otherwise edited: |
fix axes mapped to buttons and D-pads.
7743bd0
to
954b14e
Compare
Rebased following merge of #43091. |
🥳 @madmiraal !! It works! Everything is in place. Analogic stick: perfect. For the 2in1 USB Joystick in particular: This needs to be merged Thank you, @madmiraal |
Thanks a ton to both of you, amazing work! |
3.2 version of #42799.