Fix longpress gesture

This commit is contained in:
Riku Isokoski 2021-08-11 18:31:40 +03:00
parent cd7ca458fa
commit fe33c756b7
2 changed files with 6 additions and 5 deletions

View File

@ -26,14 +26,15 @@ bool TouchHandler::GetNewTouchInfo() {
}
if (info.gesture != Pinetime::Drivers::Cst816S::Gestures::None) {
if (slideReleased) {
if (gestureReleased) {
if (info.gesture == Pinetime::Drivers::Cst816S::Gestures::SlideDown ||
info.gesture == Pinetime::Drivers::Cst816S::Gestures::SlideLeft ||
info.gesture == Pinetime::Drivers::Cst816S::Gestures::SlideUp ||
info.gesture == Pinetime::Drivers::Cst816S::Gestures::SlideRight) {
info.gesture == Pinetime::Drivers::Cst816S::Gestures::SlideRight ||
info.gesture == Pinetime::Drivers::Cst816S::Gestures::LongPress) {
if (info.touching) {
gesture = info.gesture;
slideReleased = false;
gestureReleased = false;
}
} else {
gesture = info.gesture;
@ -42,7 +43,7 @@ bool TouchHandler::GetNewTouchInfo() {
}
if (!info.touching) {
slideReleased = true;
gestureReleased = true;
}
return true;

View File

@ -39,7 +39,7 @@ namespace Pinetime {
Pinetime::Components::LittleVgl& lvgl;
Pinetime::Drivers::Cst816S::Gestures gesture;
bool isCancelled = false;
bool slideReleased = true;
bool gestureReleased = true;
};
}
}