summaryrefslogtreecommitdiff
path: root/src/displayapp/LittleVgl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/displayapp/LittleVgl.cpp')
-rw-r--r--src/displayapp/LittleVgl.cpp30
1 files changed, 4 insertions, 26 deletions
diff --git a/src/displayapp/LittleVgl.cpp b/src/displayapp/LittleVgl.cpp
index c069afa2..2bd5e57b 100644
--- a/src/displayapp/LittleVgl.cpp
+++ b/src/displayapp/LittleVgl.cpp
@@ -166,43 +166,21 @@ void LittleVgl::FlushDisplay(const lv_area_t* area, lv_color_t* color_p) {
lv_disp_flush_ready(&disp_drv);
}
-void LittleVgl::SetNewTapEvent(uint16_t x, uint16_t y) {
+void LittleVgl::SetNewTouchPoint(uint16_t x, uint16_t y, bool contact) {
tap_x = x;
tap_y = y;
- tapped = true;
+ tapped = contact;
}
bool LittleVgl::GetTouchPadInfo(lv_indev_data_t* ptr) {
+ ptr->point.x = tap_x;
+ ptr->point.y = tap_y;
if (tapped) {
- ptr->point.x = tap_x;
- ptr->point.y = tap_y;
ptr->state = LV_INDEV_STATE_PR;
- tapped = false;
} else {
ptr->state = LV_INDEV_STATE_REL;
}
return false;
- /*
- auto info = touchPanel.GetTouchInfo();
-
- if((previousClick.x != info.x || previousClick.y != info.y) &&
- (info.gesture == Drivers::Cst816S::Gestures::SingleTap)) {
- // TODO For an unknown reason, the first touch is taken twice into account.
- // 'firstTouch' is a quite'n'dirty workaound until I find a better solution
- if(firstTouch) ptr->state = LV_INDEV_STATE_REL;
- else ptr->state = LV_INDEV_STATE_PR;
- firstTouch = false;
- previousClick.x = info.x;
- previousClick.y = info.y;
- }
- else {
- ptr->state = LV_INDEV_STATE_REL;
- }
-
- ptr->point.x = info.x;
- ptr->point.y = info.y;
- return false;
- */
}
void LittleVgl::InitTheme() {