mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-06 03:18:13 +00:00
Vita: Fix off-by-one error for synthetic mouse events
(cherry picked from commit cdc5483cf9
)
This commit is contained in:
@@ -122,14 +122,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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -252,7 +252,7 @@ int SDL_SendTouch(SDL_TouchID id, SDL_FingerID fingerid, SDL_Window *window,
|
|||||||
/* SDL_HINT_VITA_TOUCH_MOUSE_DEVICE: controlling which touchpad should generate synthetic mouse events, PSVita-only */
|
/* SDL_HINT_VITA_TOUCH_MOUSE_DEVICE: controlling which touchpad should generate synthetic mouse events, PSVita-only */
|
||||||
{
|
{
|
||||||
#if defined(__vita__)
|
#if defined(__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
|
||||||
|
Reference in New Issue
Block a user