mirror of https://github.com/encounter/SDL.git
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.
This commit is contained in:
parent
1a4c0d4e17
commit
2e348c1f59
|
@ -776,6 +776,7 @@ LINUX_JoystickOpen(SDL_Joystick * joystick, int device_index)
|
||||||
joystick->hwdata->guid = item->guid;
|
joystick->hwdata->guid = item->guid;
|
||||||
joystick->hwdata->effect.id = -1;
|
joystick->hwdata->effect.id = -1;
|
||||||
joystick->hwdata->m_bSteamController = item->m_bSteamController;
|
joystick->hwdata->m_bSteamController = item->m_bSteamController;
|
||||||
|
SDL_memset(joystick->hwdata->abs_map, 0xFF, sizeof(joystick->hwdata->abs_map));
|
||||||
|
|
||||||
if (item->m_bSteamController) {
|
if (item->m_bSteamController) {
|
||||||
joystick->hwdata->fd = -1;
|
joystick->hwdata->fd = -1;
|
||||||
|
@ -989,11 +990,13 @@ HandleInputEvents(SDL_Joystick * joystick)
|
||||||
HandleHat(joystick, code / 2, code % 2, events[i].value);
|
HandleHat(joystick, code / 2, code % 2, events[i].value);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
events[i].value =
|
if (joystick->hwdata->abs_map[code] != 0xFF) {
|
||||||
AxisCorrect(joystick, code, events[i].value);
|
events[i].value =
|
||||||
SDL_PrivateJoystickAxis(joystick,
|
AxisCorrect(joystick, code, events[i].value);
|
||||||
joystick->hwdata->abs_map[code],
|
SDL_PrivateJoystickAxis(joystick,
|
||||||
events[i].value);
|
joystick->hwdata->abs_map[code],
|
||||||
|
events[i].value);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue