From c508e918318f959671d6b2caa9ab4359e109f9c7 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 18 May 2026 06:52:48 -0700 Subject: [PATCH] Update src/joystick/hidapi/SDL_hidapi_steam_triton.c --- src/joystick/hidapi/SDL_hidapi_steam_triton.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/joystick/hidapi/SDL_hidapi_steam_triton.c b/src/joystick/hidapi/SDL_hidapi_steam_triton.c index d50a7f82e6..b4770f7db0 100644 --- a/src/joystick/hidapi/SDL_hidapi_steam_triton.c +++ b/src/joystick/hidapi/SDL_hidapi_steam_triton.c @@ -250,10 +250,10 @@ static void HIDAPI_DriverSteamTriton_HandleState(SDL_HIDAPI_Device *device, ctx->last_sensor_tick = pTritonReport->imu.timestamp; } - bool downLeft = pTritonReport->buttons & TRITON_LEFT_TOUCHPAD_TOUCH ? true : false; - bool downRight = pTritonReport->buttons & TRITON_RIGHT_TOUCHPAD_TOUCH ? true : false; - if (downLeft || ctx->left_touch_down){ - if (downLeft){ + bool left_touch_down = (pTritonReport->buttons & TRITON_LEFT_TOUCHPAD_TOUCH) ? true : false; + bool right_touch_down = (pTritonReport->buttons & TRITON_RIGHT_TOUCHPAD_TOUCH) ? true : false; + if (left_touch_down || ctx->left_touch_down) { + if (left_touch_down) { ctx->left_touch_x = pTritonReport->sLeftPadX / 65536.0f + 0.5f; ctx->left_touch_y = -(float)pTritonReport->sLeftPadY / 65536.0f + 0.5f;