File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -260,11 +260,23 @@ void LittleVgl::CancelTap() {
260260 }
261261}
262262
263+ void LittleVgl::SetNewTap (int16_t x, int16_t y) {
264+ touchPoint = {x, y};
265+ tapped = true ;
266+ simulate_tap_release = true ;
267+ }
268+
263269bool LittleVgl::GetTouchPadInfo (lv_indev_data_t * ptr) {
264270 ptr->point .x = touchPoint.x ;
265271 ptr->point .y = touchPoint.y ;
266272 if (tapped) {
267273 ptr->state = LV_INDEV_STATE_PR;
274+ if (simulate_tap_release) {
275+ // If a tap consists of only a single event, enqueue a synthetic release state update
276+ tapped = false ;
277+ simulate_tap_release = false ;
278+ return true ;
279+ }
268280 } else {
269281 ptr->state = LV_INDEV_STATE_REL;
270282 }
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ namespace Pinetime {
2626 void SetFullRefresh (FullRefreshDirections direction);
2727 void SetNewTouchPoint (int16_t x, int16_t y, bool contact);
2828 void CancelTap ();
29+ void SetNewTap (int16_t x, int16_t y);
2930
3031 bool GetFullRefresh () {
3132 bool returnValue = fullRefresh;
@@ -65,6 +66,7 @@ namespace Pinetime {
6566 lv_point_t touchPoint = {};
6667 bool tapped = false ;
6768 bool isCancelled = false ;
69+ bool simulate_tap_release = false ;
6870 };
6971 }
7072}
You can’t perform that action at this time.
0 commit comments