I noticed that event_handler_cb is called multiple times even if the event does not change.
I think that call back call is asynchronous and are called by the core lvgl at a pre-set time.
For example in a button press function callback, if i increment a variable, the variable increment multiple times with only one rapid press.
I need to filter the event inside the calback ???
Like:
The “LV_EVENT_CLICKED” is actuated only on release. I want on pressed state not in release state.
And with “LV_EVENT_LONG_PRESSED_REPEAT” the variable increment or decrement repeatedly after “LV_INDEV_LONG_PRESS_TIME”. Repetition time after long press time are equal “LV_INDEV_LONG_PRESS_REP_TIME”.
So when pressing the button, the variable increments “1” or “100” in my case and keeping the button pressed for time “LV_INDEV_LONG_PRESS_TIME”, the button will increment every “LV_INDEV_LONG_PRESS_REP_TIME”. Values in milliseconds.
I never used the “lv_obj_set_user_data” and “lv_obj_set_event_cb”. I’ll take a look.