Commit 361043a5f6b9b2d2693a553a80a3e56d463631e8

Sam Lantinga 2018-05-23T17:15:33

Actually left trigger is motion axis 17 and right trigger is motion axis 18, which will map in that order to SDL axes.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/src/joystick/SDL_gamecontroller.c b/src/joystick/SDL_gamecontroller.c
index 41a7831..6af3220 100644
--- a/src/joystick/SDL_gamecontroller.c
+++ b/src/joystick/SDL_gamecontroller.c
@@ -982,10 +982,10 @@ static ControllerMapping_t *SDL_CreateMappingForAndroidController(const char *na
         SDL_strlcat(mapping_string, "righty:a3,", sizeof(mapping_string));
     }
     if (axis_mask & (1 << SDL_CONTROLLER_AXIS_TRIGGERLEFT)) {
-        SDL_strlcat(mapping_string, "lefttrigger:a5,", sizeof(mapping_string));
+        SDL_strlcat(mapping_string, "lefttrigger:a4,", sizeof(mapping_string));
     }
     if (axis_mask & (1 << SDL_CONTROLLER_AXIS_TRIGGERRIGHT)) {
-        SDL_strlcat(mapping_string, "righttrigger:a4,", sizeof(mapping_string));
+        SDL_strlcat(mapping_string, "righttrigger:a5,", sizeof(mapping_string));
     }
     return SDL_PrivateAddMappingForGUID(guid, mapping_string,
                       &existing, SDL_CONTROLLER_MAPPING_PRIORITY_DEFAULT);