From 351e4861ca9648ac22b73cce369412f40c74b6ec Mon Sep 17 00:00:00 2001 From: fireph <443370+fireph@users.noreply.github.com> Date: Sun, 6 Oct 2024 03:00:35 -0700 Subject: [PATCH] Working touchpad support (#1257) * Working touchpad support Tested on PS5 controller plugged in via USB. * fix lint --- src/core/libraries/pad/pad.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/core/libraries/pad/pad.cpp b/src/core/libraries/pad/pad.cpp index 6c3b1f56..b671e007 100644 --- a/src/core/libraries/pad/pad.cpp +++ b/src/core/libraries/pad/pad.cpp @@ -368,12 +368,13 @@ int PS4_SYSV_ABI scePadReadState(s32 handle, OrbisPadData* pData) { pData->angularVelocity.x = 0.0f; pData->angularVelocity.y = 0.0f; pData->angularVelocity.z = 0.0f; - pData->touchData.touchNum = 0; - pData->touchData.touch[0].x = 0; - pData->touchData.touch[0].y = 0; + pData->touchData.touchNum = + (state.touchpad[0].state ? 1 : 0) + (state.touchpad[1].state ? 1 : 0); + pData->touchData.touch[0].x = state.touchpad[0].x; + pData->touchData.touch[0].y = state.touchpad[0].y; pData->touchData.touch[0].id = 1; - pData->touchData.touch[1].x = 0; - pData->touchData.touch[1].y = 0; + pData->touchData.touch[1].x = state.touchpad[1].x; + pData->touchData.touch[1].y = state.touchpad[1].y; pData->touchData.touch[1].id = 2; pData->timestamp = state.time; pData->connected = true; // isConnected; //TODO fix me proper