Skip to content

Commit

Permalink
Fixed bug 3193 - Dualshock 3's motion sensors overwrite analog stick
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
slouken committed Nov 14, 2018
1 parent 1a4c0d4 commit 2e348c1
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 5 deletions.
Empty file modified Android.mk 100644 → 100755
Empty file.
Empty file modified Xcode-iOS/Demos/Demos.xcodeproj/project.pbxproj 100644 → 100755
Empty file.
Empty file modified Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj 100644 → 100755
Empty file.
Empty file modified Xcode-iOS/Test/TestiPhoneOS.xcodeproj/project.pbxproj 100644 → 100755
Empty file.
Empty file modified Xcode/SDL/SDL.xcodeproj/project.pbxproj 100644 → 100755
Empty file.
Empty file modified Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj 100644 → 100755
Empty file.
13 changes: 8 additions & 5 deletions src/joystick/linux/SDL_sysjoystick.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 2e348c1

Please sign in to comment.