lv_gridnav.h

Typedefs

typedef int _keep_pedantic_happy

Enums

enum lv_gridnav_ctrl_t

Values:

enumerator LV_GRIDNAV_CTRL_NONE
enumerator LV_GRIDNAV_CTRL_ROLLOVER

If there is no next/previous object in a direction, the focus goes to the object in the next/previous row (on left/right keys) or first/last row (on up/down keys)

enumerator LV_GRIDNAV_CTRL_SCROLL_FIRST

If an arrow is pressed and the focused object can be scrolled in that direction then it will be scrolled instead of going to the next/previous object. If there is no more room for scrolling the next/previous object will be focused normally

enumerator LV_GRIDNAV_CTRL_HORIZONTAL_MOVE_ONLY

Only use left/right keys for grid navigation. Up/down key events will be sent to the focused object.

enumerator LV_GRIDNAV_CTRL_VERTICAL_MOVE_ONLY

Only use up/down keys for grid navigation. Left/right key events will be sent to the focused object.

Functions

void lv_gridnav_add(lv_obj_t *obj, lv_gridnav_ctrl_t ctrl)

Add grid navigation feature to an object. It expects the children to be arranged into a grid-like layout. Although it's not required to have pixel perfect alignment. This feature makes possible to use keys to navigate among the children and focus them. The keys other than arrows and press/release related events are forwarded to the focused child.

Parameters:
  • obj -- pointer to an object on which navigation should be applied.

  • ctrl -- control flags from lv_gridnav_ctrl_t.

void lv_gridnav_remove(lv_obj_t *obj)

Remove the grid navigation support from an object

Parameters:

obj -- pointer to an object

void lv_gridnav_set_focused(lv_obj_t *cont, lv_obj_t *to_focus, lv_anim_enable_t anim_en)

Manually focus an object on gridnav container

Parameters:
  • cont -- pointer to a gridnav container

  • to_focus -- pointer to an object to focus

  • anim_en -- LV_ANIM_ON/OFF