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

Event triggers #34

Open
nagyrobi opened this issue Jan 11, 2024 · 4 comments
Open

Event triggers #34

nagyrobi opened this issue Jan 11, 2024 · 4 comments

Comments

@nagyrobi
Copy link

nagyrobi commented Jan 11, 2024

A thought on events from:
https://docs.lvgl.io/8.3/overview/event.html

A universal on_event trigger could be implemented with a parameter type which can be chosen from an enum of LVGL events.
A few shorthands could be implemented for most popular events:

on_press-> LV_EVENT_PRESSED
on_release-> LV_EVENT_RELEASED
on_click-> LV_EVENT_SHORT_CLICKED
on_long_press-> LV_EVENT_LONG_PRESSED

on_value-> LV_EVENT_VALUE_CHANGED, returning the value in x (slider has been moved to value x, switch/btn toggled)
on_gesture-> LV_EVENT_GESTURE, returning the gesture (eg. swipe direction)

@nagyrobi
Copy link
Author

nagyrobi commented Jan 11, 2024

Fyi OpenHASP chose these: https://www.openhasp.com/0.7.0/design/objects/#events

@nagyrobi
Copy link
Author

nagyrobi commented Jan 12, 2024

We need on_value trigger because btnmatrix control flag CLICK_TRIG offers us this in a configurable way; and that seems the only way to know which button was pressed.

@nagyrobi
Copy link
Author

Also something like on_draw_end (perhaps LV_EVENT_DRAW_POST_END). Use case: after displaying a bootlogo on the top_layer, start a delay of a few seconds, and ditch the logo widget...

@clydebarrow
Copy link
Owner

On gesture and on_draw_end to be done at a later date maybe.

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

No branches or pull requests

2 participants