Gamepad: Parse SDL_GAMECONTROLLERCONFIG env after default mappings
Addresses comment https://github.com/godotengine/godot/issues/21918#issuecomment-458764923.
This commit is contained in:
parent
ed22a4c454
commit
0584c7f094
|
@ -727,9 +727,17 @@ InputDefault::InputDefault() {
|
|||
|
||||
fallback_mapping = -1;
|
||||
|
||||
// Parse default mappings.
|
||||
{
|
||||
int i = 0;
|
||||
while (DefaultControllerMappings::mappings[i]) {
|
||||
parse_mapping(DefaultControllerMappings::mappings[i++]);
|
||||
}
|
||||
}
|
||||
|
||||
// If defined, parse SDL_GAMECONTROLLERCONFIG for possible new mappings/overrides.
|
||||
String env_mapping = OS::get_singleton()->get_environment("SDL_GAMECONTROLLERCONFIG");
|
||||
if (env_mapping != "") {
|
||||
|
||||
Vector<String> entries = env_mapping.split("\n");
|
||||
for (int i = 0; i < entries.size(); i++) {
|
||||
if (entries[i] == "")
|
||||
|
@ -737,12 +745,6 @@ InputDefault::InputDefault() {
|
|||
parse_mapping(entries[i]);
|
||||
}
|
||||
}
|
||||
|
||||
int i = 0;
|
||||
while (DefaultControllerMappings::mappings[i]) {
|
||||
|
||||
parse_mapping(DefaultControllerMappings::mappings[i++]);
|
||||
}
|
||||
}
|
||||
|
||||
void InputDefault::joy_button(int p_device, int p_button, bool p_pressed) {
|
||||
|
|
Loading…
Reference in New Issue