lvgl icon indicating copy to clipboard operation
lvgl copied to clipboard

feat(gridnav): single axis movement flags

Open liamHowatt opened this issue 1 year ago • 2 comments

Description of the feature or fix

In response to #6008

Add flags to gridnav for accepting arrow keys only of a certain axis (either left/right or up/down) for grid navigation and send the ignored keys to the focused object.

LV_GRIDNAV_CTRL_HORIZONTAL_MOVE_ONLY LV_GRIDNAV_CTRL_VERTICAL_MOVE_ONLY

Add an example that uses these flags.

image

Notes

liamHowatt avatar Apr 08 '24 23:04 liamHowatt

Test added. I also made rollers emit value changed events for key presses https://github.com/lvgl/lvgl/issues/6008#issuecomment-2057615232 and improved the example so the sliders and rollers sync with each other.

liamHowatt avatar Apr 15 '24 19:04 liamHowatt

Thank you! Note that LV_EVENT_VALUE_CHANGED was sent only in release_handler() (on ENTER or on click) and not on UP/DOWN. We can send it on UP/DOWN too, but it's a different behavior than what we had before. So I'd leave is for an other PR for the sake of better visibility.

kisvegabor avatar Apr 16 '24 13:04 kisvegabor