Fix longpress gesture
This commit is contained in:
parent
cd7ca458fa
commit
fe33c756b7
|
@ -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;
|
||||
|
|
|
@ -39,7 +39,7 @@ namespace Pinetime {
|
|||
Pinetime::Components::LittleVgl& lvgl;
|
||||
Pinetime::Drivers::Cst816S::Gestures gesture;
|
||||
bool isCancelled = false;
|
||||
bool slideReleased = true;
|
||||
bool gestureReleased = true;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user