Sliding between buttons on touchpad (by mistake) causes havoc

Good day,
I have a tocuscreen application with different button (and other eleements) placed close to each other. Using it in the normal way, all works fine. However, if one slides by mistake from one button to the next while keeping touch to the screen, all kinds of functions were triggered and sometimes even the software would crash.
Note, that my software evaluates EVENT_RELEASE events to trigger functions related to the buttons.
Any idaea to get this phenomenon under control?


A few things:

  • You can apply the LV_PROTECT_PRESS_LOST attribute to the buttons so that they “capture” the touch even if your finger slides off. lv_obj_add_protect(btn, LV_PROTECT_PRESS_LOST);
  • I think the LV_EVENT_CLICKED event will only fire on the last button you release, not the one your finger slides through.

I have now a related problem with push-buttons and tocuch-screen (using LVGL v7.1): When fastly repeating pushing and releasing, littlevgl sometimes does not trigger the corresponding events (LV_EVENT_PRESSED, LV_EVENT_RELEASED). 90% of the time, this works fine, but sometimes events are not captured, apparently.
Any suggestions how to get this effect (better) under control?

This is just an educated guess, but it sounds like your touchscreen may not be polled frequently enough to react to such frequent activity. LVGL polls quite frequently by default (every 30ms) so perhaps check if there’s a setting to adjust in your driver.