From 2e348c1f5991fb7baedcd044b4ae391cbe9136b8 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 14 Nov 2018 13:37:22 -0800 Subject: [PATCH] Fixed bug 3193 - Dualshock 3's motion sensors overwrite analog stick maxxus The Dualshock 3's motion sensors don't seem to be reported by the call to EVIOCGBIT but they still send EV_ABS events. Because they're not reported by EVIOCGBIT they're not assigned a proper axis ids and the default of 0 is used, which is the valid id for the left analog sticks left/right axis. --- Android.mk | 0 Xcode-iOS/Demos/Demos.xcodeproj/project.pbxproj | 0 Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj | 0 .../Test/TestiPhoneOS.xcodeproj/project.pbxproj | 0 Xcode/SDL/SDL.xcodeproj/project.pbxproj | 0 Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj | 0 src/joystick/linux/SDL_sysjoystick.c | 13 ++++++++----- 7 files changed, 8 insertions(+), 5 deletions(-) mode change 100644 => 100755 Android.mk mode change 100644 => 100755 Xcode-iOS/Demos/Demos.xcodeproj/project.pbxproj mode change 100644 => 100755 Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj mode change 100644 => 100755 Xcode-iOS/Test/TestiPhoneOS.xcodeproj/project.pbxproj mode change 100644 => 100755 Xcode/SDL/SDL.xcodeproj/project.pbxproj mode change 100644 => 100755 Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj diff --git a/Android.mk b/Android.mk old mode 100644 new mode 100755 diff --git a/Xcode-iOS/Demos/Demos.xcodeproj/project.pbxproj b/Xcode-iOS/Demos/Demos.xcodeproj/project.pbxproj old mode 100644 new mode 100755 diff --git a/Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj b/Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj old mode 100644 new mode 100755 diff --git a/Xcode-iOS/Test/TestiPhoneOS.xcodeproj/project.pbxproj b/Xcode-iOS/Test/TestiPhoneOS.xcodeproj/project.pbxproj old mode 100644 new mode 100755 diff --git a/Xcode/SDL/SDL.xcodeproj/project.pbxproj b/Xcode/SDL/SDL.xcodeproj/project.pbxproj old mode 100644 new mode 100755 diff --git a/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj b/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj old mode 100644 new mode 100755 diff --git a/src/joystick/linux/SDL_sysjoystick.c b/src/joystick/linux/SDL_sysjoystick.c index 06a2d9a21..af331f1fe 100644 --- a/src/joystick/linux/SDL_sysjoystick.c +++ b/src/joystick/linux/SDL_sysjoystick.c @@ -776,6 +776,7 @@ LINUX_JoystickOpen(SDL_Joystick * joystick, int device_index) joystick->hwdata->guid = item->guid; joystick->hwdata->effect.id = -1; joystick->hwdata->m_bSteamController = item->m_bSteamController; + SDL_memset(joystick->hwdata->abs_map, 0xFF, sizeof(joystick->hwdata->abs_map)); if (item->m_bSteamController) { joystick->hwdata->fd = -1; @@ -989,11 +990,13 @@ HandleInputEvents(SDL_Joystick * joystick) HandleHat(joystick, code / 2, code % 2, events[i].value); break; default: - events[i].value = - AxisCorrect(joystick, code, events[i].value); - SDL_PrivateJoystickAxis(joystick, - joystick->hwdata->abs_map[code], - events[i].value); + if (joystick->hwdata->abs_map[code] != 0xFF) { + events[i].value = + AxisCorrect(joystick, code, events[i].value); + SDL_PrivateJoystickAxis(joystick, + joystick->hwdata->abs_map[code], + events[i].value); + } break; } break;