「App:Library:LVGL:docs:Overview:Input devices」の版間の差分
14行目: | 14行目: | ||
* External hardware buttons which are assigned to specific points on the screen | * External hardware buttons which are assigned to specific points on the screen | ||
− | <span style="background-color:#DBFAF3 | + | <span style="background-color:#DBFAF3;">Important<BR />Before reading further, please read the [Porting](/porting/indev) section of Input devices</span> |
| | | | ||
|} | |} | ||
199行目: | 199行目: | ||
Functions | Functions | ||
− | void lv_indev_read_timer_cb(lv_timer_t *timer) | + | <span style="background-color:#e7f2fa;color:#2980b9;">void lv_indev_read_timer_cb(lv_timer_t *timer) </span> |
: Called periodically to read the input devices | : Called periodically to read the input devices | ||
: Parameters | : Parameters | ||
:: timer -- pointer to a timer to read | :: timer -- pointer to a timer to read | ||
− | void lv_indev_enable(lv_indev_t *indev, bool en) | + | <span style="background-color:#e7f2fa;color:#2980b9;">void lv_indev_enable(lv_indev_t *indev, bool en) </span> |
: | : | ||
− | lv_indev_t *lv_indev_get_act(void) | + | <span style="background-color:#e7f2fa;color:#2980b9;">lv_indev_t *lv_indev_get_act(void) </span> |
: Get the currently processed input device. Can be used in action functions too. | : Get the currently processed input device. Can be used in action functions too. | ||
213行目: | 213行目: | ||
:: pointer to the currently processed input device or NULL if no input device processing right now | :: pointer to the currently processed input device or NULL if no input device processing right now | ||
− | lv_indev_type_t lv_indev_get_type(const lv_indev_t *indev) | + | <span style="background-color:#e7f2fa;color:#2980b9;">lv_indev_type_t lv_indev_get_type(const lv_indev_t *indev) </span> |
: Get the type of an input device | : Get the type of an input device | ||
: Parameters | : Parameters | ||
220行目: | 220行目: | ||
:: the type of the input device from <code style="color: #bb0000;">lv_hal_indev_type_t</code> (<code style="color: #bb0000;">LV_INDEV_TYPE_...</code>) | :: the type of the input device from <code style="color: #bb0000;">lv_hal_indev_type_t</code> (<code style="color: #bb0000;">LV_INDEV_TYPE_...</code>) | ||
− | void lv_indev_reset(lv_indev_t *indev, lv_obj_t *obj) | + | <span style="background-color:#e7f2fa;color:#2980b9;">void lv_indev_reset(lv_indev_t *indev, lv_obj_t *obj) </span> |
: Reset one or all input devices | : Reset one or all input devices | ||
: Parameters | : Parameters | ||
231行目: | 231行目: | ||
:: indev -- pointer to an input device | :: indev -- pointer to an input device | ||
− | void lv_indev_set_cursor(lv_indev_t *indev, lv_obj_t *cur_obj) | + | <span style="background-color:#e7f2fa;color:#2980b9;">void lv_indev_set_cursor(lv_indev_t *indev, lv_obj_t *cur_obj) </span> |
: Set a cursor for a pointer input device (for LV_INPUT_TYPE_POINTER and LV_INPUT_TYPE_BUTTON) | : Set a cursor for a pointer input device (for LV_INPUT_TYPE_POINTER and LV_INPUT_TYPE_BUTTON) | ||
: Parameters | : Parameters | ||
237行目: | 237行目: | ||
::* cur_obj -- pointer to an object to be used as cursor | ::* cur_obj -- pointer to an object to be used as cursor | ||
− | void lv_indev_set_group(lv_indev_t *indev, lv_group_t *group) | + | <span style="background-color:#e7f2fa;color:#2980b9;">void lv_indev_set_group(lv_indev_t *indev, lv_group_t *group) </span> |
: Set a destination group for a keypad input device (for LV_INDEV_TYPE_KEYPAD) | : Set a destination group for a keypad input device (for LV_INDEV_TYPE_KEYPAD) | ||
: Parameters | : Parameters | ||
243行目: | 243行目: | ||
::* group -- point to a group | ::* group -- point to a group | ||
− | void lv_indev_set_button_points(lv_indev_t *indev, const lv_point_t points[]) | + | <span style="background-color:#e7f2fa;color:#2980b9;">void lv_indev_set_button_points(lv_indev_t *indev, const lv_point_t points[]) </span> |
: Set the an array of points for LV_INDEV_TYPE_BUTTON. These points will be assigned to the buttons to press a specific point on the screen | : Set the an array of points for LV_INDEV_TYPE_BUTTON. These points will be assigned to the buttons to press a specific point on the screen | ||
: Parameters | : Parameters | ||
249行目: | 249行目: | ||
::* group -- point to a group | ::* group -- point to a group | ||
− | void lv_indev_get_point(const lv_indev_t *indev, lv_point_t *point) | + | <span style="background-color:#e7f2fa;color:#2980b9;">void lv_indev_get_point(const lv_indev_t *indev, lv_point_t *point) </span> |
: Get the last point of an input device (for LV_INDEV_TYPE_POINTER and LV_INDEV_TYPE_BUTTON) | : Get the last point of an input device (for LV_INDEV_TYPE_POINTER and LV_INDEV_TYPE_BUTTON) | ||
: Parameters | : Parameters | ||
255行目: | 255行目: | ||
::* point -- pointer to a point to store the result | ::* point -- pointer to a point to store the result | ||
− | lv_dir_t lv_indev_get_gesture_dir(const lv_indev_t *indev) | + | <span style="background-color:#e7f2fa;color:#2980b9;">lv_dir_t lv_indev_get_gesture_dir(const lv_indev_t *indev) </span> |
: Get the current gesture direct | : Get the current gesture direct | ||
: Parameters | : Parameters | ||
262行目: | 262行目: | ||
:: current gesture direct | :: current gesture direct | ||
− | uint32_t lv_indev_get_key(const lv_indev_t *indev) | + | <span style="background-color:#e7f2fa;color:#2980b9;">uint32_t lv_indev_get_key(const lv_indev_t *indev) </span> |
: Get the last pressed key of an input device (for LV_INDEV_TYPE_KEYPAD) | : Get the last pressed key of an input device (for LV_INDEV_TYPE_KEYPAD) | ||
: Parameters | : Parameters | ||
269行目: | 269行目: | ||
:: the last pressed key (0 on error) | :: the last pressed key (0 on error) | ||
− | lv_dir_t lv_indev_get_scroll_dir(const lv_indev_t *indev) | + | <span style="background-color:#e7f2fa;color:#2980b9;">lv_dir_t lv_indev_get_scroll_dir(const lv_indev_t *indev) </span> |
: Check the current scroll direction of an input device (for LV_INDEV_TYPE_POINTER and LV_INDEV_TYPE_BUTTON) | : Check the current scroll direction of an input device (for LV_INDEV_TYPE_POINTER and LV_INDEV_TYPE_BUTTON) | ||
: Parameters | : Parameters | ||
276行目: | 276行目: | ||
:: LV_DIR_NONE: no scrolling now LV_DIR_HOR/VER | :: LV_DIR_NONE: no scrolling now LV_DIR_HOR/VER | ||
− | lv_obj_t *lv_indev_get_scroll_obj(const lv_indev_t *indev) | + | <span style="background-color:#e7f2fa;color:#2980b9;">lv_obj_t *lv_indev_get_scroll_obj(const lv_indev_t *indev) </span> |
: Get the currently scrolled object (for LV_INDEV_TYPE_POINTER and LV_INDEV_TYPE_BUTTON) | : Get the currently scrolled object (for LV_INDEV_TYPE_POINTER and LV_INDEV_TYPE_BUTTON) | ||
: Parameters | : Parameters | ||
283行目: | 283行目: | ||
:: pointer to the currently scrolled object or NULL if no scrolling by this indev | :: pointer to the currently scrolled object or NULL if no scrolling by this indev | ||
− | void lv_indev_get_vect(const lv_indev_t *indev, lv_point_t *point) | + | <span style="background-color:#e7f2fa;color:#2980b9;">void lv_indev_get_vect(const lv_indev_t *indev, lv_point_t *point) </span> |
: Get the movement vector of an input device (for LV_INDEV_TYPE_POINTER and LV_INDEV_TYPE_BUTTON) | : Get the movement vector of an input device (for LV_INDEV_TYPE_POINTER and LV_INDEV_TYPE_BUTTON) | ||
: Parameters | : Parameters | ||
289行目: | 289行目: | ||
::* point -- pointer to a point to store the types.pointer.vector | ::* point -- pointer to a point to store the types.pointer.vector | ||
− | void lv_indev_wait_release(lv_indev_t *indev) | + | <span style="background-color:#e7f2fa;color:#2980b9;">void lv_indev_wait_release(lv_indev_t *indev) </span> |
: Do nothing until the next release | : Do nothing until the next release | ||
: Parameters | : Parameters | ||
:: indev -- pointer to an input device | :: indev -- pointer to an input device | ||
− | lv_obj_t *lv_indev_get_obj_act(void) | + | <span style="background-color:#e7f2fa;color:#2980b9;">lv_obj_t *lv_indev_get_obj_act(void) </span> |
: Gets a pointer to the currently active object in the currently processed input device. | : Gets a pointer to the currently active object in the currently processed input device. | ||
: Returns | : Returns | ||
:: pointer to currently active object or NULL if no active object | :: pointer to currently active object or NULL if no active object | ||
− | lv_timer_t *lv_indev_get_read_timer(lv_disp_t *indev) | + | <span style="background-color:#e7f2fa;color:#2980b9;">lv_timer_t *lv_indev_get_read_timer(lv_disp_t *indev) </span> |
: Get a pointer to the indev read timer to modify its parameters with <code style="color: #bb0000;">lv_timer_...</code> functions. | : Get a pointer to the indev read timer to modify its parameters with <code style="color: #bb0000;">lv_timer_...</code> functions. | ||
: Parameters | : Parameters | ||
306行目: | 306行目: | ||
:: pointer to the indev read refresher timer. (NULL on error) | :: pointer to the indev read refresher timer. (NULL on error) | ||
− | lv_obj_t *lv_indev_search_obj(lv_obj_t *obj, lv_point_t *point) | + | <span style="background-color:#e7f2fa;color:#2980b9;">lv_obj_t *lv_indev_search_obj(lv_obj_t *obj, lv_point_t *point) </span> |
: Search the most top, clickable object by a point | : Search the most top, clickable object by a point | ||
: Parameters | : Parameters | ||
326行目: | 326行目: | ||
Typedefs | Typedefs | ||
− | typedef uint8_t lv_key_t | + | <span style="background-color:#e7f2fa;color:#2980b9;">typedef uint8_t lv_key_t </span> |
: | : | ||
− | typedef void (*lv_group_focus_cb_t)(struct _lv_group_t*) | + | <span style="background-color:#e7f2fa;color:#2980b9;">typedef void (*lv_group_focus_cb_t)(struct _lv_group_t*) </span> |
: | : | ||
− | typedef struct _lv_group_t lv_group_t | + | <span style="background-color:#e7f2fa;color:#2980b9;">typedef struct _lv_group_t lv_group_t </span> |
: Groups can be used to logically hold objects so that they can be individually focused. They are NOT for laying out objects on a screen (try layouts for that). | : Groups can be used to logically hold objects so that they can be individually focused. They are NOT for laying out objects on a screen (try layouts for that). | ||
Enums | Enums | ||
− | enum [anonymous] | + | <span style="background-color:#e7f2fa;color:#2980b9;">enum [anonymous] </span> |
: ''Values:'' | : ''Values:'' | ||
− | : enumerator LV_KEY_UP | + | : <span style="background-color: #eeeeee;">enumerator LV_KEY_UP </span> |
:: | :: | ||
− | : enumerator LV_KEY_DOWN | + | : <span style="background-color: #eeeeee;">enumerator LV_KEY_DOWN </span> |
:: | :: | ||
− | : enumerator LV_KEY_RIGHT | + | : <span style="background-color: #eeeeee;">enumerator LV_KEY_RIGHT </span> |
:: | :: | ||
− | : enumerator LV_KEY_LEFT | + | : <span style="background-color: #eeeeee;">enumerator LV_KEY_LEFT </span> |
:: | :: | ||
− | : enumerator LV_KEY_ESC | + | : <span style="background-color: #eeeeee;">enumerator LV_KEY_ESC </span> |
:: | :: | ||
− | : enumerator LV_KEY_DEL | + | : <span style="background-color: #eeeeee;">enumerator LV_KEY_DEL </span> |
:: | :: | ||
− | : enumerator LV_KEY_BACKSPACE | + | : <span style="background-color: #eeeeee;">enumerator LV_KEY_BACKSPACE </span> |
:: | :: | ||
− | : enumerator LV_KEY_ENTER | + | : <span style="background-color: #eeeeee;">enumerator LV_KEY_ENTER </span> |
:: | :: | ||
− | : enumerator LV_KEY_NEXT | + | : <span style="background-color: #eeeeee;">enumerator LV_KEY_NEXT </span> |
:: | :: | ||
− | : enumerator LV_KEY_PREV | + | : <span style="background-color: #eeeeee;">enumerator LV_KEY_PREV </span> |
:: | :: | ||
− | : enumerator LV_KEY_HOME | + | : <span style="background-color: #eeeeee;">enumerator LV_KEY_HOME </span> |
:: | :: | ||
− | : enumerator LV_KEY_END | + | : <span style="background-color: #eeeeee;">enumerator LV_KEY_END </span> |
:: | :: | ||
− | enum lv_group_refocus_policy_t | + | <span style="background-color:#e7f2fa;color:#2980b9;">enum lv_group_refocus_policy_t </span> |
: ''Values:'' | : ''Values:'' | ||
− | : enumerator LV_GROUP_REFOCUS_POLICY_NEXT | + | : <span style="background-color: #eeeeee;">enumerator LV_GROUP_REFOCUS_POLICY_NEXT </span> |
:: | :: | ||
− | : enumerator LV_GROUP_REFOCUS_POLICY_PREV | + | : <span style="background-color: #eeeeee;">enumerator LV_GROUP_REFOCUS_POLICY_PREV </span> |
:: | :: | ||
Functions | Functions | ||
− | void _lv_group_init(void) | + | <span style="background-color:#e7f2fa;color:#2980b9;">void _lv_group_init(void) </span> |
: Init. the group module | : Init. the group module | ||
: Remark | : Remark | ||
:: Internal function, do not call directly. | :: Internal function, do not call directly. | ||
− | lv_group_t *lv_group_create(void) | + | <span style="background-color:#e7f2fa;color:#2980b9;">lv_group_t *lv_group_create(void) </span> |
: Create a new object group | : Create a new object group | ||
: Returns | : Returns | ||
:: pointer to the new object group | :: pointer to the new object group | ||
− | void lv_group_del(lv_group_t *group) | + | <span style="background-color:#e7f2fa;color:#2980b9;">void lv_group_del(lv_group_t *group) </span> |
: Delete a group object | : Delete a group object | ||
: Parameters | : Parameters | ||
:: group -- pointer to a group | :: group -- pointer to a group | ||
− | void lv_group_set_default(lv_group_t *group) | + | <span style="background-color:#e7f2fa;color:#2980b9;">void lv_group_set_default(lv_group_t *group) </span> |
: Set a default group. New object are added to this group if it's enabled in their class with <code style="color: #bb0000;">add_to_def_group = true</code> | : Set a default group. New object are added to this group if it's enabled in their class with <code style="color: #bb0000;">add_to_def_group = true</code> | ||
: Parameters | : Parameters | ||
:: group -- pointer to a group (can be <code style="color: #bb0000;">NULL</code>) | :: group -- pointer to a group (can be <code style="color: #bb0000;">NULL</code>) | ||
− | lv_group_t *lv_group_get_default(void) | + | <span style="background-color:#e7f2fa;color:#2980b9;">lv_group_t *lv_group_get_default(void) </span> |
: Get the default group | : Get the default group | ||
: Returns | : Returns | ||
399行目: | 399行目: | ||
:: pointer to the default group | :: pointer to the default group | ||
− | void lv_group_add_obj(lv_group_t *group, struct _lv_obj_t *obj) | + | <span style="background-color:#e7f2fa;color:#2980b9;">void lv_group_add_obj(lv_group_t *group, struct _lv_obj_t *obj) </span> |
: Add an object to a group | : Add an object to a group | ||
: Parameters | : Parameters | ||
405行目: | 405行目: | ||
::* obj -- pointer to an object to add | ::* obj -- pointer to an object to add | ||
− | void lv_group_swap_obj(struct _lv_obj_t *obj1, struct _lv_obj_t *obj2) | + | <span style="background-color:#e7f2fa;color:#2980b9;">void lv_group_swap_obj(struct _lv_obj_t *obj1, struct _lv_obj_t *obj2) </span> |
: Swap 2 object in a group. The object must be in the same group | : Swap 2 object in a group. The object must be in the same group | ||
: Parameters | : Parameters | ||
411行目: | 411行目: | ||
::* obj2 -- pointer to an other object | ::* obj2 -- pointer to an other object | ||
− | void lv_group_remove_obj(struct _lv_obj_t *obj) | + | <span style="background-color:#e7f2fa;color:#2980b9;">void lv_group_remove_obj(struct _lv_obj_t *obj) </span> |
: Remove an object from its group | : Remove an object from its group | ||
: Parameters | : Parameters | ||
:: obj -- pointer to an object to remove | :: obj -- pointer to an object to remove | ||
− | void lv_group_remove_all_objs(lv_group_t *group) | + | <span style="background-color:#e7f2fa;color:#2980b9;">void lv_group_remove_all_objs(lv_group_t *group) </span> |
: Remove all objects from a group | : Remove all objects from a group | ||
: Parameters | : Parameters | ||
:: group -- pointer to a group | :: group -- pointer to a group | ||
− | void lv_group_focus_obj(struct _lv_obj_t *obj) | + | <span style="background-color:#e7f2fa;color:#2980b9;">void lv_group_focus_obj(struct _lv_obj_t *obj) </span> |
: Focus on an object (defocus the current) | : Focus on an object (defocus the current) | ||
: | : | ||
427行目: | 427行目: | ||
:: obj -- pointer to an object to focus on | :: obj -- pointer to an object to focus on | ||
− | void lv_group_focus_next(lv_group_t *group) | + | <span style="background-color:#e7f2fa;color:#2980b9;">void lv_group_focus_next(lv_group_t *group) </span> |
: Focus the next object in a group (defocus the current) | : Focus the next object in a group (defocus the current) | ||
: Parameters | : Parameters | ||
:: group -- pointer to a group | :: group -- pointer to a group | ||
− | void lv_group_focus_prev(lv_group_t *group) | + | <span style="background-color:#e7f2fa;color:#2980b9;">void lv_group_focus_prev(lv_group_t *group) </span> |
: Focus the previous object in a group (defocus the current) | : Focus the previous object in a group (defocus the current) | ||
: Parameters | : Parameters | ||
:: group -- pointer to a group | :: group -- pointer to a group | ||
− | void lv_group_focus_freeze(lv_group_t *group, bool en) | + | <span style="background-color:#e7f2fa;color:#2980b9;">void lv_group_focus_freeze(lv_group_t *group, bool en) </span> |
: Do not let to change the focus from the current object | : Do not let to change the focus from the current object | ||
: Parameters | : Parameters | ||
443行目: | 443行目: | ||
::* en -- true: freeze, false: release freezing (normal mode) | ::* en -- true: freeze, false: release freezing (normal mode) | ||
− | lv_res_t lv_group_send_data(lv_group_t *group, uint32_t c) | + | <span style="background-color:#e7f2fa;color:#2980b9;">lv_res_t lv_group_send_data(lv_group_t *group, uint32_t c) </span> |
: Send a control character to the focuses object of a group | : Send a control character to the focuses object of a group | ||
: Parameters | : Parameters | ||
451行目: | 451行目: | ||
:: result of focused object in group. | :: result of focused object in group. | ||
− | void lv_group_set_focus_cb(lv_group_t *group, lv_group_focus_cb_t focus_cb) | + | <span style="background-color:#e7f2fa;color:#2980b9;">void lv_group_set_focus_cb(lv_group_t *group, lv_group_focus_cb_t focus_cb) </span> |
: Set a function for a group which will be called when a new object is focused | : Set a function for a group which will be called when a new object is focused | ||
: Parameters | : Parameters | ||
457行目: | 457行目: | ||
::* focus_cb -- the call back function or NULL if unused | ::* focus_cb -- the call back function or NULL if unused | ||
− | void lv_group_set_refocus_policy(lv_group_t *group, lv_group_refocus_policy_t policy) | + | <span style="background-color:#e7f2fa;color:#2980b9;">void lv_group_set_refocus_policy(lv_group_t *group, lv_group_refocus_policy_t policy) </span> |
: Set whether the next or previous item in a group is focused if the currently focused obj is deleted. | : Set whether the next or previous item in a group is focused if the currently focused obj is deleted. | ||
: Parameters | : Parameters | ||
463行目: | 463行目: | ||
::* policy -- new refocus policy enum | ::* policy -- new refocus policy enum | ||
− | void lv_group_set_editing(lv_group_t *group, bool edit) | + | <span style="background-color:#e7f2fa;color:#2980b9;">void lv_group_set_editing(lv_group_t *group, bool edit) </span> |
: Manually set the current mode (edit or navigate). | : Manually set the current mode (edit or navigate). | ||
: | : | ||
470行目: | 470行目: | ||
::* edit -- true: edit mode; false: navigate mode | ::* edit -- true: edit mode; false: navigate mode | ||
− | void lv_group_set_wrap(lv_group_t *group, bool en) | + | <span style="background-color:#e7f2fa;color:#2980b9;">void lv_group_set_wrap(lv_group_t *group, bool en) </span> |
: Set whether focus next/prev will allow wrapping from first->last or last->first object. | : Set whether focus next/prev will allow wrapping from first->last or last->first object. | ||
: Parameters | : Parameters | ||
476行目: | 476行目: | ||
::* en -- true: wrapping enabled; false: wrapping disabled | ::* en -- true: wrapping enabled; false: wrapping disabled | ||
− | struct _lv_obj_t *lv_group_get_focused(const lv_group_t *group) | + | <span style="background-color:#e7f2fa;color:#2980b9;">struct _lv_obj_t *lv_group_get_focused(const lv_group_t *group) </span> |
: Get the focused object or NULL if there isn't one | : Get the focused object or NULL if there isn't one | ||
: Parameters | : Parameters | ||
483行目: | 483行目: | ||
:: pointer to the focused object | :: pointer to the focused object | ||
− | lv_group_focus_cb_t lv_group_get_focus_cb(const lv_group_t *group) | + | <span style="background-color:#e7f2fa;color:#2980b9;">lv_group_focus_cb_t lv_group_get_focus_cb(const lv_group_t *group) </span> |
: Get the focus callback function of a group | : Get the focus callback function of a group | ||
: Parameters | : Parameters | ||
490行目: | 490行目: | ||
:: the call back function or NULL if not set | :: the call back function or NULL if not set | ||
− | bool lv_group_get_editing(const lv_group_t *group) | + | <span style="background-color:#e7f2fa;color:#2980b9;">bool lv_group_get_editing(const lv_group_t *group) </span> |
: Get the current mode (edit or navigate). | : Get the current mode (edit or navigate). | ||
: Parameters | : Parameters | ||
497行目: | 497行目: | ||
:: true: edit mode; false: navigate mode | :: true: edit mode; false: navigate mode | ||
− | bool lv_group_get_wrap(lv_group_t *group) | + | <span style="background-color:#e7f2fa;color:#2980b9;">bool lv_group_get_wrap(lv_group_t *group) </span> |
: Get whether focus next/prev will allow wrapping from first->last or last->first object. | : Get whether focus next/prev will allow wrapping from first->last or last->first object. | ||
: Parameters | : Parameters | ||
503行目: | 503行目: | ||
::* en -- true: wrapping enabled; false: wrapping disabled | ::* en -- true: wrapping enabled; false: wrapping disabled | ||
− | uint32_t lv_group_get_obj_count(lv_group_t *group) | + | <span style="background-color:#e7f2fa;color:#2980b9;">uint32_t lv_group_get_obj_count(lv_group_t *group) </span> |
: Get the number of object in the group | : Get the number of object in the group | ||
: Parameters | : Parameters | ||
510行目: | 510行目: | ||
:: number of objects in the group | :: number of objects in the group | ||
− | struct _lv_group_t | + | <span style="background-color:#e7f2fa;color:#2980b9;">struct _lv_group_t </span> |
: ''#include <lv_g''''roup.h>'' Groups can be used to logically hold objects so that they can be individually focused. They are NOT for laying out objects on a screen (try layouts for that). Public Members | : ''#include <lv_g''''roup.h>'' Groups can be used to logically hold objects so that they can be individually focused. They are NOT for laying out objects on a screen (try layouts for that). Public Members | ||
− | : lv_ll_t obj_ll | + | : <span style="background-color: #eeeeee;">lv_ll_t obj_ll </span> |
:: Linked list to store the objects in the group | :: Linked list to store the objects in the group | ||
− | : struct _lv_obj_t **obj_focus | + | : <span style="background-color: #eeeeee;">struct _lv_obj_t **obj_focus </span> |
:: The object in focus | :: The object in focus | ||
− | : lv_group_focus_cb_t focus_cb | + | : <span style="background-color: #eeeeee;">lv_group_focus_cb_t focus_cb </span> |
:: A function to call when a new object is focused (optional) | :: A function to call when a new object is focused (optional) | ||
− | : void *user_data | + | : <span style="background-color: #eeeeee;">void *user_data </span> |
:: | :: | ||
− | : uint8_t frozen | + | : <span style="background-color: #eeeeee;">uint8_t frozen </span> |
:: 1: can't focus to new object | :: 1: can't focus to new object | ||
− | : uint8_t editing | + | : <span style="background-color: #eeeeee;">uint8_t editing </span> |
:: 1: Edit mode, 0: Navigate mode | :: 1: Edit mode, 0: Navigate mode | ||
− | : uint8_t refocus_policy | + | : <span style="background-color: #eeeeee;">uint8_t refocus_policy </span> |
:: 1: Focus prev if focused on deletion. 0: Focus next if focused on deletion. | :: 1: Focus prev if focused on deletion. 0: Focus next if focused on deletion. | ||
− | : uint8_t wrap | + | : <span style="background-color: #eeeeee;">uint8_t wrap </span> |
:: 1: Focus next/prev can wrap at end of list. 0: Focus next/prev stops at end of list. | :: 1: Focus next/prev can wrap at end of list. 0: Focus next/prev stops at end of list. | ||
| | | |
2022年7月1日 (金) 10:05時点における版
https://docs.lvgl.io/8.2/overview/indev.html
Input devices
英文 | 自動翻訳 |
---|---|
An input device usually means:
Important |
Pointers
Cursor
英文 | 自動翻訳 |
---|---|
Pointer input devices (like a mouse) can have a cursor. ...
lv_indev_t * mouse_indev = lv_indev_drv_register(&indev_drv);
LV_IMG_DECLARE(mouse_cursor_icon); /*Declare the image source.*/
lv_obj_t * cursor_obj = lv_img_create(lv_scr_act()); /*Create an image object for the cursor */
lv_img_set_src(cursor_obj, &mouse_cursor_icon); /*Set the image source*/
lv_indev_set_cursor(mouse_indev, cursor_obj); /*Connect the image object to the driver*/
Note that the cursor object should have |
Gestures
英文 | 自動翻訳 |
---|---|
Pointer input devices can detect basic gestures. By default, most of the widgets send the gestures to its parent, so finally the gestures can be detected on the screen object in a form of an void my_event(lv_event_t * e)
{
lv_obj_t * screen = lv_event_get_current_target(e);
lv_dir_t dir = lv_indev_get_gesture_dir(lv_indev_act());
switch(dir) {
case LV_DIR_LEFT:
...
break;
case LV_DIR_RIGHT:
...
break;
case LV_DIR_TOP:
...
break;
case LV_DIR_BOTTOM:
...
break;
}
}
...
lv_obj_add_event_cb(screen1, my_event, LV_EVENT_GESTURE, NULL);
To prevent passing the gesture event to the parent from an object use Note that, gestures are not triggered if an object is being scrolled. |
Keypad and encoder
英文 | 自動翻訳 |
---|---|
You can fully control the user interface without a touchpad or mouse by using a keypad or encoder(s). It works similar to the TAB key on the PC to select an element in an application or a web page. |
Groups
英文 | 自動翻訳 |
---|---|
Objects you want to control with a keypad or encoder need to be added to a Group. In every group there is exactly one focused object which receives the pressed keys or the encoder actions. For example, if a Text area is focused and you press some letter on a keyboard, the keys will be sent and inserted into the text area. Similarly, if a Slider is focused and you press the left or right arrows, the slider's value will be changed. You need to associate an input device with a group. An input device can send key events to only one group but a group can receive data from more than one input device. To create a group use To associate a group with an input device use |
Keys
英文 | 自動翻訳 |
---|---|
There are some predefined keys which have special meaning:
The most important special keys are Usually, it's enough to use only With an encoder you should use only |
英文 | 自動翻訳 |
---|---|
Since a keypad has plenty of keys, it's easy to navigate between objects and edit them using the keypad. But encoders have a limited number of "keys" and hence it is difficult to navigate using the default options. Navigate and Edit modes are used to avoid this problem with encoders. In Navigate mode, an encoder's In Edit mode, |
Default group
英文 | 自動翻訳 |
---|---|
Interactive widgets - such as buttons, checkboxes, sliders, etc. - can be automatically added to a default group. Just create a group with Don't forget to assign one or more input devices to the default group with |
Styling
英文 | 自動翻訳 |
---|---|
If an object is focused either by clicking it via touchpad or focused via an encoder or keypad it goes to the If an object switches to edit mode it enters the For a more detailed description read the Style section. |
API
Input device
英文 | 自動翻訳 |
---|---|
Functions void lv_indev_read_timer_cb(lv_timer_t *timer)
void lv_indev_enable(lv_indev_t *indev, bool en) lv_indev_t *lv_indev_get_act(void)
lv_indev_type_t lv_indev_get_type(const lv_indev_t *indev)
void lv_indev_reset(lv_indev_t *indev, lv_obj_t *obj)
void lv_indev_reset_long_press(lv_indev_t *indev)
void lv_indev_set_cursor(lv_indev_t *indev, lv_obj_t *cur_obj)
void lv_indev_set_group(lv_indev_t *indev, lv_group_t *group)
void lv_indev_set_button_points(lv_indev_t *indev, const lv_point_t points[])
void lv_indev_get_point(const lv_indev_t *indev, lv_point_t *point)
lv_dir_t lv_indev_get_gesture_dir(const lv_indev_t *indev)
uint32_t lv_indev_get_key(const lv_indev_t *indev)
lv_dir_t lv_indev_get_scroll_dir(const lv_indev_t *indev)
lv_obj_t *lv_indev_get_scroll_obj(const lv_indev_t *indev)
void lv_indev_get_vect(const lv_indev_t *indev, lv_point_t *point)
void lv_indev_wait_release(lv_indev_t *indev)
lv_obj_t *lv_indev_get_obj_act(void)
lv_timer_t *lv_indev_get_read_timer(lv_disp_t *indev)
lv_obj_t *lv_indev_search_obj(lv_obj_t *obj, lv_point_t *point)
|
Groups
英文 | 自動翻訳 |
---|---|
Typedefs typedef uint8_t lv_key_t typedef void (*lv_group_focus_cb_t)(struct _lv_group_t*) typedef struct _lv_group_t lv_group_t
Enums enum [anonymous]
enum lv_group_refocus_policy_t
Functions void _lv_group_init(void)
lv_group_t *lv_group_create(void)
void lv_group_del(lv_group_t *group)
void lv_group_set_default(lv_group_t *group)
lv_group_t *lv_group_get_default(void)
void lv_group_add_obj(lv_group_t *group, struct _lv_obj_t *obj)
void lv_group_swap_obj(struct _lv_obj_t *obj1, struct _lv_obj_t *obj2)
void lv_group_remove_obj(struct _lv_obj_t *obj)
void lv_group_remove_all_objs(lv_group_t *group)
void lv_group_focus_obj(struct _lv_obj_t *obj)
void lv_group_focus_next(lv_group_t *group)
void lv_group_focus_prev(lv_group_t *group)
void lv_group_focus_freeze(lv_group_t *group, bool en)
lv_res_t lv_group_send_data(lv_group_t *group, uint32_t c)
void lv_group_set_focus_cb(lv_group_t *group, lv_group_focus_cb_t focus_cb)
void lv_group_set_refocus_policy(lv_group_t *group, lv_group_refocus_policy_t policy)
void lv_group_set_editing(lv_group_t *group, bool edit)
void lv_group_set_wrap(lv_group_t *group, bool en)
struct _lv_obj_t *lv_group_get_focused(const lv_group_t *group)
lv_group_focus_cb_t lv_group_get_focus_cb(const lv_group_t *group)
bool lv_group_get_editing(const lv_group_t *group)
bool lv_group_get_wrap(lv_group_t *group)
uint32_t lv_group_get_obj_count(lv_group_t *group)
struct _lv_group_t
|