We'll just use the legacy names for face buttons in the mappings

This fixes being able to accidentally rebind the face buttons in testcontroller
This commit is contained in:
Sam Lantinga
2023-11-15 22:09:09 -08:00
parent 051ed397d1
commit 57e5c7f6ee
2 changed files with 19 additions and 62 deletions

View File

@@ -2292,33 +2292,9 @@ static void ConvertBAXYMapping(MappingParts *parts)
}
}
static void UseLegacyButtonNames(MappingParts *parts)
{
int i;
for (i = 0; i < parts->num_elements; ++i) {
char *key = parts->keys[i];
if (SDL_strcmp(key, "s") == 0) {
parts->keys[i] = SDL_strdup("a");
SDL_free(key);
} else if (SDL_strcmp(key, "e") == 0) {
parts->keys[i] = SDL_strdup("b");
SDL_free(key);
} else if (SDL_strcmp(key, "w") == 0) {
parts->keys[i] = SDL_strdup("x");
SDL_free(key);
} else if (SDL_strcmp(key, "n") == 0) {
parts->keys[i] = SDL_strdup("y");
SDL_free(key);
}
}
}
static void UpdateLegacyElements(MappingParts *parts)
{
ConvertBAXYMapping(parts);
UseLegacyButtonNames(parts);
}
static SDL_bool CombineMappingAxes(MappingParts *parts)