Added the gamepad hint SDL_GAMECONTROLLER_USE_GAMECUBE_LABELS

This is for internal use to signal that a mapping uses positional GameCube buttons. It's set so we know whether a mapping uses the older style labeled buttons or the newer style positional buttons. If a positional mapping is used with SDL2, then it will be ignored, since the hint is marked as defaulting true and the mapping conditional is that the hint is false.
This commit is contained in:
Sam Lantinga 2025-05-01 10:35:49 -07:00
parent 21a7bbbf14
commit 48dfc03a87
4 changed files with 132 additions and 70 deletions

View file

@ -478,17 +478,6 @@ static void CommitBindingElement(const char *binding, bool force)
mapping = NULL;
}
if (mapping && SDL_GetGamepadType(controller->gamepad) == SDL_GAMEPAD_TYPE_GAMECUBE) {
if (SDL_strstr(mapping, "face:") == NULL) {
char *new_mapping = NULL;
SDL_asprintf(&new_mapping, "%sface:axby,", mapping);
if (new_mapping) {
SDL_free(mapping);
mapping = new_mapping;
}
}
}
/* If the controller generates multiple events for a single element, pick the best one */
if (!force && binding_advance_time) {
char *current = GetElementBinding(mapping, binding_element);