aboutsummaryrefslogtreecommitdiffstats
path: root/src/touchhandler
diff options
context:
space:
mode:
Diffstat (limited to 'src/touchhandler')
-rw-r--r--src/touchhandler/TouchHandler.cpp30
-rw-r--r--src/touchhandler/TouchHandler.h10
2 files changed, 4 insertions, 36 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);
- }
- }
-}
diff --git a/src/touchhandler/TouchHandler.h b/src/touchhandler/TouchHandler.h
index afce2844..9afaa247 100644
--- a/src/touchhandler/TouchHandler.h
+++ b/src/touchhandler/TouchHandler.h
@@ -3,10 +3,6 @@
#include "displayapp/TouchEvents.h"
namespace Pinetime {
- namespace Components {
- class LittleVgl;
- }
-
namespace Drivers {
class Cst816S;
}
@@ -14,10 +10,9 @@ namespace Pinetime {
namespace Controllers {
class TouchHandler {
public:
- explicit TouchHandler(Drivers::Cst816S&, Components::LittleVgl&);
- void CancelTap();
+ explicit TouchHandler(Drivers::Cst816S&);
+
bool GetNewTouchInfo();
- void UpdateLvglTouchPoint();
bool IsTouching() const {
return info.touching;
@@ -36,7 +31,6 @@ namespace Pinetime {
private:
Pinetime::Drivers::Cst816S::TouchInfos info;
Pinetime::Drivers::Cst816S& touchPanel;
- Pinetime::Components::LittleVgl& lvgl;
Pinetime::Applications::TouchEvents gesture;
bool isCancelled = false;
bool gestureReleased = true;