-
-
Notifications
You must be signed in to change notification settings - Fork 21.7k
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
Update joy button and stick names, enums and documentation #43591
Conversation
Updated the enums to match the standardised names with numerical, SDL and controller specific alternatives mapping to the standardised one. Also updated the documentation to reflect this. |
6d4ffbf
to
3dc64aa
Compare
Hm I'm a bit conflicted about these changes, it's a huge amount of bindings in a list that was already pretty unwieldy with all those aliases. Should we go in the other direction and drop unnecessarily redundant bindings? IMO we should standardize on a standard gamepad "picture" much like SDL does, and drop all the Xbox, Sony or Nintendo equivalents. I don't see much point in using them, documentation can cover the equivalence between our own "standard" gamepad and the face buttons on mainstream consoles. As for all the For 4.0 we should really use the opportunity and make this list actually useful and easy to read. As for the "standard" gamepad naming for the "action" buttons, I don't have a strong opinion on whether we should |
I'm in favour of just having the basic SDL enums:
However, there were objections when other equivalents were being deleted in #38151. I'm also in favour of deleting the methods:
I don't know of a need for |
Keeping the VR aliases might make sense as those aliases are different from a "standard" Xbox/Sony/Nintendo controller, and the mapping of VR buttons to SDL buttons might not be obvious. Paging @BastiaanOlij @aaronfranke. Some thoughts on the proposed enums:
Serializing is maybe not the best use case indeed, but I think those methods can be used to display human-readable names for the buttons. If you want to make a controls remapping UI, you need a way to present the user with a name, and this is one option if you're not implementing your own names map. I thought the InputMapEditor used them, but it seems to have its own hardcoded names for those. At the very least we should likely sync them / make the InputMapEditor use the Input methods... otherwise it's indeed a sign that the Input string methods might not be that useful. |
To be honest I don't have a strong opinion on these. I'd say the aliases are fine, as, usually, users are only fine with one type of layout (I still can't remember about the position of A, B, X and Y on a Xbox controller ^^). I may be biased here, but I think the aliases do not hurt that much. But I am fine with a smaller enum too.
I agree on that.
I would keep only the getters then. I don't think the setting from string is needed. |
core/input/input.cpp
Outdated
"Bottom Action", | ||
"Right Action", | ||
"Left Action", | ||
"Top Action", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like this change at all. Why "Top Action" but not "Select Action" or "Guide Action"? What is "Top" the top of, if we're not specifying that these are the face buttons?
I'm also wondering if it would be a better idea to just go with "A button", "B button", etc. Pretty much every controller except for Sony and Nintendo controllers use the SDL layout (based on the Xbox layout), including Xbox controllers, Stadia controller, Steam controllers, most Android controllers, and most other generic controllers.
Even if the names would be inconsistent with Sony/Nintendo, every game developer knows about the difference in game controllers, and if they're developing/testing with a Nintendo controller then the mismatch will be immediately clear so that they know to use the SDL/Xbox/Steam/Stadia/Android/etc layout in code.
The redundancy in the enum is not really a problem, but I agree that just listing out numbers 0-35 is rather pointless. I await the return of the VR enum values :)
I already did this as part of #38054, but it's awaiting your review. These PRs are absolutely going to conflict with each other... |
@akien-mga if this isn't going to be backported to 3.2 and solely a breaking change in 4.0 I wouldn't worry about VR. If all goes through with the work we discussed around OpenXR the current line of thinking is to adopt Valve and OpenXRs approach using action based inputs. Those inputs can then be mapped to our standard buttons for each given VR controller. Even if we stick to the current approach those SDL buttons cover everything, I much rather have us stick to proper button mappings so the plugins adhere to Godots button definition then having a separate set like we do now. The original approach stems from a time that nobody knew how this would evolve. |
Updated to reflect all the above feedback as best I can. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpicks and suggestions, but otherwise looks great to me!
Added trailing commas, slightly updated the editor mapping descriptions and updated the documentation. |
Thanks! |
TTRC("Joystick 2 Up"), | ||
TTRC("Joystick 2 Down, Right Trigger, R2, RT"), | ||
TTRC("Right Trigger, R2, RT, Joystick 2 Down"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here for some reason "Sony" and "Xbox" were left out of L2/R2 and LT/RT, whereas they are present in descriptions everywhere else. I will add this in #43660
Closes #43520.