From 48e2bcd73a29c4a5b4279d84ebc49d07a0136670 Mon Sep 17 00:00:00 2001 From: GaryOderNichts <12049776+GaryOderNichts@users.noreply.github.com> Date: Wed, 5 Apr 2023 18:14:19 +0200 Subject: [PATCH] wiiu/joystick: Fix touch holding detection --- src/joystick/wiiu/SDL_wiiujoystick.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/joystick/wiiu/SDL_wiiujoystick.c b/src/joystick/wiiu/SDL_wiiujoystick.c index 7bf4adad4..d448231a2 100644 --- a/src/joystick/wiiu/SDL_wiiujoystick.c +++ b/src/joystick/wiiu/SDL_wiiujoystick.c @@ -465,10 +465,12 @@ static void WIIU_JoystickUpdate(SDL_Joystick *joystick) /* touchscreen */ VPADGetTPCalibratedPoint(VPAD_CHAN_0, &tpdata, &vpad.tpNormal); if (tpdata.touched) { - /* Send an initial touch */ - SDL_SendTouch(0, 0, NULL, SDL_TRUE, - (float) tpdata.x / 1280.0f, - (float) tpdata.y / 720.0f, 1); + if (!last_touched) { + /* Send an initial touch */ + SDL_SendTouch(0, 0, NULL, SDL_TRUE, + (float) tpdata.x / 1280.0f, + (float) tpdata.y / 720.0f, 1); + } /* Always send the motion */ SDL_SendTouchMotion(0, 0, NULL,