Events
For more detailed information, please refer to this link:
https://docs.lvgl.io/8.3/overview/event.html
Triggering Events
| Common Widget Events | |
|---|---|
| LV_EVENT_PRESSED | Object is pressed |
| LV_EVENT_PRESSING | Continuously called while the object is pressed |
| LV_EVENT_PRESS_LOST | Cursor/finger slides away from the object while still pressing it |
| LV_EVENT_SHORT_CLICKED | Object is short-clicked |
| LV_EVENT_LONG_PRESSED | Object is long-pressed |
| LV_EVENT_LONG_PRESSED_REPEAT | Called every millisecond while the object is long-pressed |
| LV_EVENT_CLICKED | Object is released after being pressed without scrolling |
| LV_EVENT_RELEASED | Object is released, including scrolling |
| LV_EVENT_SCROLL_BEGIN | Scrolling starts |
| LV_EVENT_SCROLL_END | Scrolling ends |
| LV_EVENT_SCROLL | Object is being scrolled |
| LV_EVENT_KEY | Key is sent to the object from input devices like keyboard encoders |
| LV_EVENT_FOCUSED | Object is focused |
| LV_EVENT_DEFOCUSED | Object is defocused |
| LV_EVENT_LEAVE | Object is no longer focused but remains selected |
| LV_EVENT_HIT_TEST | Advanced hit test is performed |
| LV_EVENT_VALUE_CHANGED | Object's value has changed |
| Screen-Specific Events | |
|---|---|
| LV_EVENT_SCREEN_UNLOAD_START | Screen unload starts |
| LV_EVENT_SCREEN_LOAD_START | Screen load starts |
| LV_EVENT_SCREEN_LOADED | Screen has loaded |
| LV_EVENT_SCREEN_UNLOADED | Screen has unloaded |
| LV_EVENT_GESTURE_LEFT | Gesture detected: left |
| LV_EVENT_GESTURE_RIGHT | Gesture detected: right |
| LV_EVENT_GESTURE_TOP | Gesture detected: up |
| LV_EVENT_GESTURE_BOTTOM | Gesture detected: down |
Screen Loading
| Screen Load Animations | |
|---|---|
| LV_SCR_LOAD_ANIM_NONE | No animation when loading screen |
| LV_SCR_LOAD_ANIM_OVER_LEFT | New screen slides in from the right |
| LV_SCR_LOAD_ANIM_OVER_RIGHT | New screen slides in from the left |
| LV_SCR_LOAD_ANIM_OVER_TOP | New screen slides in from the bottom |
| LV_SCR_LOAD_ANIM_OVER_BOTTOM | New screen slides in from the top |
| LV_SCR_LOAD_ANIM_MOVE_LEFT | New screen slides in from the right while the old screen slides out to the left |
| LV_SCR_LOAD_ANIM_MOVE_RIGHT | New screen slides in from the left while the old screen slides out to the right |
| LV_SCR_LOAD_ANIM_MOVE_TOP | New screen slides in from the bottom while the old screen slides out to the top |
| LV_SCR_LOAD_ANIM_MOVE_BOTTOM | New screen slides in from the top while the old screen slides out to the bottom |
| LV_SCR_LOAD_ANIM_FADE_IN | New screen fades in while the old screen fades out |
| LV_SCR_LOAD_ANIM_FADE_ON | New screen fades in while the old screen fades out |
| LV_SCR_LOAD_ANIM_FADE_OUT | Old screen fades out |
| LV_SCR_LOAD_ANIM_OUT_LEFT | Old screen slides out to the left |
| LV_SCR_LOAD_ANIM_OUT_RIGHT | Old screen slides out to the right |
| LV_SCR_LOAD_ANIM_OUT_TOP | Old screen slides out to the top |
| LV_SCR_LOAD_ANIM_OUT_BOTTOM | Old screen slides out to the bottom |
States
| Adding States | |
|---|---|
| LV_STATE_DEFAULT | Normal release state |
| LV_STATE_CHECKED | Checked state |
| LV_STATE_FOCUSED | Focused state |
| LV_STATE_FOCUS_KEY | Keyboard focused state |
| LV_STATE_EDITED | Edited state |
| LV_STATE_HOVERED | Hovered state (not supported) |
| LV_STATE_PRESSED | Pressed state |
| LV_STATE_SCROLLED | Scrolled state |
| LV_STATE_DISABLED | Disabled state |
Widget Events
- Select "Interactions" from the right navigation bar and add the corresponding trigger event.
- Choose the widget that needs the event modification, and enter the corresponding event design panel.
- Modify the value that needs to be triggered. If this item is highlighted, it means it has been set. If it is gray, it means this item is not changed in the event.
- If this setting is not needed, click the clear mark in the upper right corner of the corresponding area.
Example
Below is an example of common menu button event switching, showing the effect:

The steps to add an event can be referenced below:

Page Load Events
- Select "Interactions" from the right navigation bar and add the corresponding trigger event.
- Choose the event that needs to trigger the page load, select the page to load, and whether to automatically delete the old page.
- Check the corresponding cancel page load event.
Example
Below is an example of common left-right swipe page switch events, showing the effect:

The steps to add an event can be referenced below:

8MS