summaryrefslogtreecommitdiff
path: root/src/displayapp/DisplayApp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/displayapp/DisplayApp.cpp')
-rw-r--r--src/displayapp/DisplayApp.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp
index 6d66afe5..1aacefd2 100644
--- a/src/displayapp/DisplayApp.cpp
+++ b/src/displayapp/DisplayApp.cpp
@@ -177,7 +177,8 @@ void DisplayApp::Refresh() {
case Messages::TouchEvent: {
if (state != States::Running)
break;
- auto gesture = OnTouchEvent();
+ auto info = touchPanel.GetTouchInfo();
+ auto gesture = OnTouchEvent(info);
if (!currentScreen->OnTouchEvent(gesture)) {
if (currentApp == Apps::Clock) {
switch (gesture) {
@@ -198,6 +199,10 @@ void DisplayApp::Refresh() {
}
} else if (returnTouchEvent == gesture) {
LoadApp(returnToApp, returnDirection);
+ } else if (touchMode == TouchModes::Gestures) {
+ if (gesture == TouchEvents::Tap) {
+ lvgl.SetNewTapEvent(info.x, info.y);
+ }
}
}
} break;
@@ -393,14 +398,10 @@ void DisplayApp::PushMessage(Messages msg) {
}
}
-TouchEvents DisplayApp::OnTouchEvent() {
- auto info = touchPanel.GetTouchInfo();
+TouchEvents DisplayApp::OnTouchEvent(Pinetime::Drivers::Cst816S::TouchInfos info) {
if (info.isTouch) {
switch (info.gesture) {
case Pinetime::Drivers::Cst816S::Gestures::SingleTap:
- if (touchMode == TouchModes::Gestures) {
- lvgl.SetNewTapEvent(info.x, info.y);
- }
return TouchEvents::Tap;
case Pinetime::Drivers::Cst816S::Gestures::LongPress:
return TouchEvents::LongTap;