From 559d4415ebd121224df6ce29106795bd5aa0a7f4 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Mon, 19 May 2025 08:32:23 -0700
Subject: [PATCH] Fixed touch not being delivered as mouse events by default on
Vita
Closes https://github.com/libsdl-org/SDL/pull/13070
(cherry picked from commit 25f2376e791d6ca913945a349ea06b642bb69179)
---
src/events/SDL_mouse.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/src/events/SDL_mouse.c b/src/events/SDL_mouse.c
index d84f5592ac2d0..92f99134420cd 100644
--- a/src/events/SDL_mouse.c
+++ b/src/events/SDL_mouse.c
@@ -138,21 +138,25 @@ static void SDLCALL SDL_TouchMouseEventsChanged(void *userdata, const char *name
#ifdef SDL_PLATFORM_VITA
static void SDLCALL SDL_VitaTouchMouseDeviceChanged(void *userdata, const char *name, const char *oldValue, const char *hint)
{
+ Uint8 vita_touch_mouse_device = 1;
+
SDL_Mouse *mouse = (SDL_Mouse *)userdata;
if (hint) {
switch (*hint) {
- default:
case '0':
- mouse->vita_touch_mouse_device = 1;
+ vita_touch_mouse_device = 1;
break;
case '1':
- mouse->vita_touch_mouse_device = 2;
+ vita_touch_mouse_device = 2;
break;
case '2':
- mouse->vita_touch_mouse_device = 3;
+ vita_touch_mouse_device = 3;
+ break;
+ default:
break;
}
}
+ mouse->vita_touch_mouse_device = vita_touch_mouse_device;
}
#endif