aboutsummaryrefslogtreecommitdiffstats
path: root/src/touchhandler/TouchHandler.cpp
diff options
context:
space:
mode:
authorRiku Isokoski <riksu9000@gmail.com>2023-02-23 13:28:04 +0200
committerRiku Isokoski <riksu9000@gmail.com>2023-02-24 00:05:21 +0200
commit7066ff5aba3d2643a35ba98379ff24143da99c3c (patch)
tree79f997e532579529f6c5bcf0be0380d5160db993 /src/touchhandler/TouchHandler.cpp
parent6542f255cdb38c5c3baba47ef50993e2c5a2bcc5 (diff)
touchhandler: Remove LVGL dependency
Move LVGL specific code to the LittleVgl class
Diffstat (limited to 'src/touchhandler/TouchHandler.cpp')
-rw-r--r--src/touchhandler/TouchHandler.cpp30
1 files changed, 2 insertions, 28 deletions
diff --git a/src/touchhandler/TouchHandler.cpp b/src/touchhandler/TouchHandler.cpp
index 0e4fb541..d98d2577 100644
--- a/src/touchhandler/TouchHandler.cpp
+++ b/src/touchhandler/TouchHandler.cpp
@@ -1,9 +1,4 @@
#include "touchhandler/TouchHandler.h"
-#ifdef PINETIME_IS_RECOVERY
- #include "displayapp/DummyLittleVgl.h"
-#else
- #include "displayapp/LittleVgl.h"
-#endif
using namespace Pinetime::Controllers;
using namespace Pinetime::Applications;
@@ -32,14 +27,7 @@ namespace {
}
}
-TouchHandler::TouchHandler(Drivers::Cst816S& touchPanel, Components::LittleVgl& lvgl) : touchPanel {touchPanel}, lvgl {lvgl} {
-}
-
-void TouchHandler::CancelTap() {
- if (info.touching) {
- isCancelled = true;
- lvgl.SetNewTouchPoint(-1, -1, true);
- }
+TouchHandler::TouchHandler(Drivers::Cst816S& touchPanel) : touchPanel {touchPanel} {
}
Pinetime::Applications::TouchEvents TouchHandler::GestureGet() {
@@ -55,6 +43,7 @@ bool TouchHandler::GetNewTouchInfo() {
return false;
}
+ // Only a single gesture per touch
if (info.gesture != Pinetime::Drivers::Cst816S::Gestures::None) {
if (gestureReleased) {
if (info.gesture == Pinetime::Drivers::Cst816S::Gestures::SlideDown ||
@@ -78,18 +67,3 @@ bool TouchHandler::GetNewTouchInfo() {
return true;
}
-
-void TouchHandler::UpdateLvglTouchPoint() {
- if (info.touching) {
- if (!isCancelled) {
- lvgl.SetNewTouchPoint(info.x, info.y, true);
- }
- } else {
- if (isCancelled) {
- lvgl.SetNewTouchPoint(-1, -1, false);
- isCancelled = false;
- } else {
- lvgl.SetNewTouchPoint(info.x, info.y, false);
- }
- }
-}