Open Meorge opened 9 months ago
I get similar mapping errors with an Xbox One controller on Mac, using a similar system and Godot 4.3.dev setup, as in #68976
I get similar mapping errors with an Xbox One controller on Mac, using a similar system and Godot 4.3.dev setup, as in #68976
Which 4.3.dev commit are you using? https://github.com/godotengine/godot/pull/80709 was merged after 4.3.dev3 was released, so I suggest building master
from source and testing this again.
I tested my Xbox Wireless Controller (model 1708) on 4.3.dev3, and its inputs appear to be working as expected:
https://github.com/godotengine/godot/assets/9957987/b5df244d-3f0e-4c0d-abd5-993bcfa3da6e
On v4.3.dev.gh [b15105a35], the Xbox Wireless Controller's ABXY buttons all seem to be mapped correctly for me as well. However, Godot no longer recognizes controller inputs when it is not focused:
https://github.com/godotengine/godot/assets/9957987/3f72ac01-6196-4778-955a-6d3663d67a9b
I'm not sure if this is something I should open a new issue for...? 😅
However, Godot no longer recognizes controller inputs when it is not focused:
This may be a design decision in the GameController API. cc @bruvzg
However, many people may actually welcome this new behavior, even though it's inconsistent with other platforms: https://github.com/godotengine/godot/issues/16832
It should be possible to enable background listening (it's off by default on macOS 11.3+).
I was able to clone, build, and run the Godot source today for the first time! 😁 I might see spots in the code that could be responsible for the button mapping issue, so I'll see if I can fix it.
I get similar mapping errors with an Xbox One controller on Mac, using a similar system and Godot 4.3.dev setup, as in #68976
Which 4.3.dev commit are you using? #80709 was merged after 4.3.dev3 was released, so I suggest building
master
from source and testing this again.
You are correct, this version fixes the xbox one controller mapping issue for me. Thanks!
Okay, so upon a little further investigation, I have good news and bad news.
The good news: this doesn't appear to be a bug in Godot or #80709 !
The bad news: it's just how Apple decided the Pro Controller should be mapped. 🙃 In this video, I'm pressing A, B, Y, X in order. But the controller test website displays the same wrong mapping, until I go into the Game Controllers section of System Settings and manually remap the buttons.
https://github.com/godotengine/godot/assets/9957987/2cf0181a-8322-485b-bc16-fab6faec72d9
I assume Apple did this with the intent of preserving the "semantic meaning" of the buttons - the right button is "confirm" everywhere, the bottom button is "cancel" everywhere, etc. But it's quite frustrating that this no longer has a consistent physical mapping across controllers. How should the Godot side proceed with this?
If anyone else happens to be familiar with the GameController API and knows a good solution to this, then that would be great! Otherwise, over the coming days, I may see what I can learn about it and if there's a way to query the controller for the hardware-level buttons instead of going through the inputs after they've been processed by the API and profiles. Don't know if that'll lead anywhere, but I suppose it's worth a shot.
SDL have remapping for these buttons hardcoded (based on controller name), we probably should do the same:
Tested versions
Reproducible in Godot v4.3.dev (b15105a35)
System information
Godot v4.3.dev (b15105a35) - macOS 14.3.1 - Vulkan (Forward+) - dedicated AMD Radeon Pro 5500 XT - Intel(R) Core(TM) i7-10700K CPU @ 3.80GHz (16 Threads)
Issue description
The mappings for the A, B, X, and Y buttons on the Nintendo Switch Pro Controller are off. The A and B buttons are switched, as are the X and Y buttons. I've attached a short video of my pressing the buttons on the controller and seeing what the editor picked up.
https://github.com/godotengine/godot/assets/9957987/0598d279-d0de-462b-8e24-4bc9ceb4c182
Steps to reproduce
Joypad Button 0 (Bottom Action, Sony Cross, Xbox A, Nintendo B)
, despite it being the Right Action button.Joypad Button 1 (Right Action, Sony Circle, Xbox B, Nintendo A)
, despite it being the Bottom Action button.Joypad Button 2 (Left Action, Sony Square, Xbox X, Nintendo Y)
, despite it being the Top Action button.Joypad Button 3 (Top Action, Sony Triangle, Xbox Y, Nintendo X)
, despite it being the Left Action button.Minimal reproduction project (MRP)
N/A