Hi
Currently, lvgl gestures can only recognize four common gestures: up, down, left, and right.
In some of my projects, I need to use the edge gesture triggering like the mobile phone. Currently, I can determine whether it is triggered within the margin I need by judging the x and y coordinates of the gesture end. On a page without scrolling, I can easily implement this function by adding my callback. But it is very troublesome when there is a scrolling page. I need to pass the click to the page through the LV_OBJ_FLAG_EVENT_BUBBLE event first, and disable these scrolling OBJs by judging whether the pressed point is at the edge of the screen. Only then can the gesture be triggered. According to the left side of the end after the gesture is triggered, it can be judged whether it is the edge gesture I need.
So I hope I can add an edge gesture event, and when the edge gesture is triggered, it will not be affected by the scrolling of the scroll obj.I believe this feature will become a mainstream demand in the future
I have already made it like this, but it is troublesome to use in some scenarios. I hope LVGL engineers can integrate this function into the standard function of LVGL.0
What if you add a 30px wide transparent rectangle to the left, that can be dragged in?
I have tried it, and this requires adding a transparent obj to all page edges. Because lv_layer_top does not seem to be able to receive gestures
Gestures should work with lv_layer_top
too but you need to add the LV_OBJ_FLAG_CLICKABLE
flag to it.
I tried to make sure that the top page can indeed receive gestures. It was the callback function before. Thank you.
Form the event callback you can call any functions. Even you can manually send a gesture event to the active screen using lv_obj_send_event
.
cool, May I ask how you implemented this feature