From 0d24d2b81e995d37bb7fb363df21a19b195107b8 Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Thu, 15 Jul 2021 23:18:05 +0300 Subject: [PATCH] Quick fix --- src/drivers/Cst816s.cpp | 2 +- src/touchhandler/TouchHandler.cpp | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/drivers/Cst816s.cpp b/src/drivers/Cst816s.cpp index adb984e0..127fe1ec 100644 --- a/src/drivers/Cst816s.cpp +++ b/src/drivers/Cst816s.cpp @@ -81,7 +81,7 @@ Cst816S::TouchInfos Cst816S::GetTouchInfo() { info.x = x; info.y = y; - info.action = action; + info.finger = nbTouchPoints; info.gesture = static_cast(touchData[gestureIndex]); return info; diff --git a/src/touchhandler/TouchHandler.cpp b/src/touchhandler/TouchHandler.cpp index a13d1af3..90b4d6da 100644 --- a/src/touchhandler/TouchHandler.cpp +++ b/src/touchhandler/TouchHandler.cpp @@ -39,13 +39,11 @@ void TouchHandler::Work() { } else { x = info.x; y = info.y; - if (info.action == 0) { - lvgl.SetNewTapEvent(info.x, info.y, true); - } else if (info.action == 1) { + if (info.finger == 0) { lvgl.SetNewTapEvent(info.x, info.y, false); prevGesture = Pinetime::Drivers::Cst816S::Gestures::None; isCancelled = false; - } else if (info.action == 2) { + } else if (info.finger == 1) { if (!isCancelled) { lvgl.SetNewTapEvent(info.x, info.y, true); }