Browse Source

Fixed trying to add a game controller mapping for the accelerometer on iOS

Fixes https://github.com/libsdl-org/SDL/issues/8716

(cherry picked from commit 0e5ea3cc4b98d061688a098836254ab6470b07e8)
Sam Lantinga 1 year ago
parent
commit
857e5b08c3
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/joystick/iphoneos/SDL_mfijoystick.m

+ 3 - 0
src/joystick/iphoneos/SDL_mfijoystick.m

@@ -1834,6 +1834,9 @@ static SDL_bool IOS_JoystickGetGamepadMapping(int device_index, SDL_GamepadMappi
     if (device == NULL) {
         return SDL_FALSE;
     }
+    if (device->accelerometer) {
+        return SDL_FALSE;
+    }
 
     if (@available(macOS 10.16, iOS 14.0, tvOS 14.0, *)) {
         int axis = 0;