From 8fe279c91b33bdec3d573a26de9d6a6e8dc09c59 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Thu, 14 May 2026 22:14:50 -0500 Subject: [PATCH] Add support for controllers with dual touchpads --- app/streaming/input/gamepad.cpp | 7 ++++++- moonlight-common-c/moonlight-common-c | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/streaming/input/gamepad.cpp b/app/streaming/input/gamepad.cpp index e0d7f004..9b046b33 100644 --- a/app/streaming/input/gamepad.cpp +++ b/app/streaming/input/gamepad.cpp @@ -460,7 +460,9 @@ void SdlInputHandler::handleControllerTouchpadEvent(SDL_ControllerTouchpadEvent* return; } - LiSendControllerTouchEvent((uint8_t)state->index, eventType, event->finger, event->x, event->y, event->pressure); + LiSendControllerTouchEvent2((uint8_t)state->index, eventType, + (uint8_t)event->touchpad, event->finger, + event->x, event->y, event->pressure); } #endif @@ -662,6 +664,9 @@ void SdlInputHandler::handleControllerDeviceEvent(SDL_ControllerDeviceEvent* eve } if (SDL_GameControllerGetNumTouchpads(state->controller) > 0) { capabilities |= LI_CCAP_TOUCHPAD; + if (SDL_GameControllerGetNumTouchpads(state->controller) > 1) { + capabilities |= LI_CCAP_DUAL_TOUCHPAD; + } } if (SDL_GameControllerHasSensor(state->controller, SDL_SENSOR_ACCEL)) { capabilities |= LI_CCAP_ACCEL; diff --git a/moonlight-common-c/moonlight-common-c b/moonlight-common-c/moonlight-common-c index 7b026e77..2600beaf 160000 --- a/moonlight-common-c/moonlight-common-c +++ b/moonlight-common-c/moonlight-common-c @@ -1 +1 @@ -Subproject commit 7b026e77be62175104640e7e722b758df6d3d0d7 +Subproject commit 2600beaf13f18bfa43453609cf5e3b84a4227760