summaryrefslogtreecommitdiff
path: root/src/displayapp/LittleVgl.cpp
diff options
context:
space:
mode:
authorhubmartin <hub.martin@gmail.com>2021-08-29 11:43:50 +0200
committerhubmartin <hub.martin@gmail.com>2021-08-29 11:43:50 +0200
commit8390d0ef7243261675aab3a5c19862eb3fc53e68 (patch)
treea8429e8d2a455df8afe152197119075b5789e9fb /src/displayapp/LittleVgl.cpp
parent51c5257548efe678ec8e18d8cdea2476672f1238 (diff)
parent6c023785e53c507f7cb20703f5f3a221ea095068 (diff)
Merge branch 'develop' into pinmap
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() {