summaryrefslogtreecommitdiff
path: root/src/touchhandler
diff options
context:
space:
mode:
authorRiku Isokoski <riksu9000@gmail.com>2021-07-15 21:07:55 (GMT)
committerRiku Isokoski <riksu9000@gmail.com>2021-07-15 21:07:55 (GMT)
commit2a3e1263906d1145d6b539ff019362f0077d8097 (patch)
tree1fdfa2947ccba67f1f62bf0660e6d578f35d366a /src/touchhandler
parent0d24d2b81e995d37bb7fb363df21a19b195107b8 (diff)
Fix most issues
Diffstat (limited to 'src/touchhandler')
-rw-r--r--src/touchhandler/TouchHandler.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/touchhandler/TouchHandler.cpp b/src/touchhandler/TouchHandler.cpp
index 90b4d6d..c6f8629 100644
--- a/src/touchhandler/TouchHandler.cpp
+++ b/src/touchhandler/TouchHandler.cpp
@@ -9,7 +9,7 @@ TouchHandler::TouchHandler(Drivers::Cst816S& touchPanel, Components::LittleVgl&
void TouchHandler::CancelTap() {
isCancelled = true;
- lvgl.SetNewTapEvent(-1, -1, false);
+ lvgl.SetNewTouchPoint(-1, -1, true);
}
Pinetime::Drivers::Cst816S::Gestures TouchHandler::GestureGet() {
@@ -19,7 +19,7 @@ Pinetime::Drivers::Cst816S::Gestures TouchHandler::GestureGet() {
}
void TouchHandler::Start() {
- if (pdPASS != xTaskCreate(TouchHandler::Process, "Touch", 80, this, 0, &taskHandle)) {
+ if (pdPASS != xTaskCreate(TouchHandler::Process, "Touch", 100, this, 0, &taskHandle)) {
APP_ERROR_HANDLER(NRF_ERROR_NO_MEM);
}
}
@@ -39,13 +39,9 @@ void TouchHandler::Work() {
} else {
x = info.x;
y = info.y;
- if (info.finger == 0) {
- lvgl.SetNewTapEvent(info.x, info.y, false);
- prevGesture = Pinetime::Drivers::Cst816S::Gestures::None;
- isCancelled = false;
- } else if (info.finger == 1) {
+ if (info.touching) {
if (!isCancelled) {
- lvgl.SetNewTapEvent(info.x, info.y, true);
+ lvgl.SetNewTouchPoint(info.x, info.y, true);
}
if (info.gesture != Pinetime::Drivers::Cst816S::Gestures::None) {
if (prevGesture != info.gesture) {
@@ -53,6 +49,14 @@ void TouchHandler::Work() {
gesture = info.gesture;
}
}
+ } else {
+ if (isCancelled) {
+ lvgl.SetNewTouchPoint(-1, -1, false);
+ isCancelled = false;
+ } else {
+ lvgl.SetNewTouchPoint(info.x, info.y, false);
+ }
+ prevGesture = Pinetime::Drivers::Cst816S::Gestures::None;
}
systemTask->OnTouchEvent();
}