Commit 808c3ae61263ea6100844f0f205ca4156f41d60c

Sam Lantinga 2021-07-24T10:36:56

Allow mapping Android controllers that just have a D-PAD and face buttons This fixes bug https://github.com/libsdl-org/SDL/issues/4327

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/joystick/SDL_gamecontroller.c b/src/joystick/SDL_gamecontroller.c
index 87663f5..90d11dc 100644
--- a/src/joystick/SDL_gamecontroller.c
+++ b/src/joystick/SDL_gamecontroller.c
@@ -485,7 +485,7 @@ static ControllerMapping_t *SDL_CreateMappingForAndroidController(SDL_JoystickGU
         /* Accelerometer, shouldn't have a game controller mapping */
         return NULL;
     }
-    if (!(button_mask & face_button_mask) || !axis_mask) {
+    if (!(button_mask & face_button_mask)) {
         /* We don't know what buttons or axes are supported, don't make up a mapping */
         return NULL;
     }