mirror of https://github.com/libsdl-org/SDL.git
Vita: Fix off-by-one error for synthetic mouse events
This commit is contained in:
parent
07a5c144c6
commit
cdc5483cf9
|
|
@ -143,14 +143,14 @@ static void SDLCALL SDL_VitaTouchMouseDeviceChanged(void *userdata, const char *
|
||||||
switch (*hint) {
|
switch (*hint) {
|
||||||
default:
|
default:
|
||||||
case '0':
|
case '0':
|
||||||
mouse->vita_touch_mouse_device = 0;
|
|
||||||
break;
|
|
||||||
case '1':
|
|
||||||
mouse->vita_touch_mouse_device = 1;
|
mouse->vita_touch_mouse_device = 1;
|
||||||
break;
|
break;
|
||||||
case '2':
|
case '1':
|
||||||
mouse->vita_touch_mouse_device = 2;
|
mouse->vita_touch_mouse_device = 2;
|
||||||
break;
|
break;
|
||||||
|
case '2':
|
||||||
|
mouse->vita_touch_mouse_device = 3;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -267,7 +267,7 @@ void SDL_SendTouch(Uint64 timestamp, SDL_TouchID id, SDL_FingerID fingerid, SDL_
|
||||||
// FIXME: maybe we should only restrict to a few SDL_TouchDeviceType
|
// FIXME: maybe we should only restrict to a few SDL_TouchDeviceType
|
||||||
if ((id != SDL_MOUSE_TOUCHID) && (id != SDL_PEN_TOUCHID)) {
|
if ((id != SDL_MOUSE_TOUCHID) && (id != SDL_PEN_TOUCHID)) {
|
||||||
#ifdef SDL_PLATFORM_VITA
|
#ifdef SDL_PLATFORM_VITA
|
||||||
if (mouse->touch_mouse_events && ((mouse->vita_touch_mouse_device == id) || (mouse->vita_touch_mouse_device == 2))) {
|
if (mouse->touch_mouse_events && ((mouse->vita_touch_mouse_device == id) || (mouse->vita_touch_mouse_device == 3))) {
|
||||||
#else
|
#else
|
||||||
if (mouse->touch_mouse_events) {
|
if (mouse->touch_mouse_events) {
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue