-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
[macOS] Remap Switch controller buttons. #89001
base: master
Are you sure you want to change the base?
Conversation
Just tested it. The button mapping looks good, except that the top (X) button on the Pro Controller (and the Joy-Cons, when both are connected at the same time) is mapped to Joypad Button 1 (Nintendo A). When an individual Joy-Con is connected, the south button (when holding it like a standalone controller) maps correctly to Joypad Button 0 (Nintendo B), but the other buttons don't seem to have a mapping at all. |
I'm learning a bit more about the Game Controller framework, and happened upon https://developer.apple.com/documentation/gamecontroller/gccontrollerliveinput/4165510-unmapped This could potentially be used to get around the system-level remapping that macOS provides. From there, getting the correct button mappings for the face buttons should be straightforward: https://developer.apple.com/documentation/gamecontroller/gcextendedgamepad
|
I've submitted a PR to the branch that fixes the top button mapping! |
Thanks for the bump! Unfortunately, I'm not sure if it would make sense to merge this currently. From the investigation I did back in February and March, it appeared that the bad button mapping was something built in to macOS, not Godot. Here is a snippet from the bug report I submitted to Apple on March 16:
I just tried the Pro Controller again on the latest macOS Sonoma, 14.6.1, and the issue is still there (just using an online gamepad tester, no Godot involved). Hopefully for the sake of games on Apple platforms, they'll fix it on their end. But I'm not sure if it makes sense for Godot to implement an edge-case workaround for these controllers, because they'll conflict with OS-level overrides and such. While I think we could theoretically revert the macOS controller support to use systems other than the Game Controller framework (basically undoing #80709), that seems like a bad idea:
Wiser and more experienced minds than myself may have stronger opinions about how to proceed here. The two feasible paths I see are:
|
Should fix #88693, not tested, based on SDL code.