Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(gridnav): single axis movement flags #6044

Merged
merged 6 commits into from
May 2, 2024

Conversation

liamHowatt
Copy link
Collaborator

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

Copy link
Member

@kisvegabor kisvegabor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wonderful! Could you also add basic test for both? The lv_test_indev.h API can be used in the tests.

@liamHowatt
Copy link
Collaborator Author

Test added. I also made rollers emit value changed events for key presses #6008 (comment) and improved the example so the sliders and rollers sync with each other.

@kisvegabor
Copy link
Member

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.

Copy link
Member

@kisvegabor kisvegabor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! All good for me!

@FASTSHIFT FASTSHIFT merged commit a1a909f into lvgl:master May 2, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants