lvgl
lvgl copied to clipboard
feat(gridnav): single axis movement flags
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.
Notes
- Update the Documentation if needed.
- Add Examples if relevant.
- Add Tests if applicable.
- If you added new options to
lv_conf_template.hrun lv_conf_internal_gen.py and update Kconfig. - Run
scripts/code-format.py(astyle version v3.4.12 needs to be installed) and follow the Code Conventions. - Mark the Pull request as Draft while you are working on the first version, and mark is as Ready when it's ready for review.
- When changes were requested, re-request review to notify the maintainers.
- Help us to review this Pull Request! Anyone can approve or request changes.
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.
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.