lv_test_indev.h
API reference for lv_test_indev.h
Functions
lv_test_indev_get_indev
Get one of the indev created in lv_test_indev_create_all
lv_indev_t * lv_test_indev_get_indev(lv_indev_type_t type)| Name | Type | Description |
|---|---|---|
type | lv_indev_type_t | type of the indev to get |
Returns: lv_indev_t * — the indev
lv_test_indev_create_all
Create a mouse (pointer), keypad, and encoder indevs. They can be controlled via function calls during the test
void lv_test_indev_create_all(void)lv_test_indev_delete_all
Delete all test input devices
void lv_test_indev_delete_all(void)lv_test_mouse_move_to
Move the mouse to the given coordinates. This function doesn't wait, but just changes the state and returns immediately.
void lv_test_mouse_move_to(int32_t x, int32_t y)| Name | Type | Description |
|---|---|---|
x | int32_t | the target absolute X coordinate |
y | int32_t | the target absolute Y coordinate |
lv_test_mouse_move_to_obj
Move the mouse to the center of a widget This function doesn't wait, but just changes the state and returns immediately.
void lv_test_mouse_move_to_obj(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to an widget |
lv_test_mouse_move_by
Move the mouse cursor. Keep the pressed or released state This function doesn't wait, but just changes the state and returns immediately.
void lv_test_mouse_move_by(int32_t x, int32_t y)| Name | Type | Description |
|---|---|---|
x | int32_t | the difference in X to move |
y | int32_t | the difference in Y to move |
lv_test_mouse_press
Make the mouse button pressed. This function doesn't wait, but just changes the state and returns immediately.
void lv_test_mouse_press(void)lv_test_mouse_release
Make the mouse button released. This function doesn't wait, but just changes the state and returns immediately.
void lv_test_mouse_release(void)lv_test_mouse_click_at
Emulate a click on a given point. First set the released state, wait a little, press, wait, and release again. The wait time is 50ms. Internally lv_timer_handler is called, meaning all the events will be fired inside this function.
void lv_test_mouse_click_at(int32_t x, int32_t y)| Name | Type | Description |
|---|---|---|
x | int32_t | the target absolute X coordinate |
y | int32_t | the target absolute Y coordinate |
lv_test_key_press
Emulate a key press. This function doesn't wait, but just changes the state and returns immediately.
void lv_test_key_press(uint32_t k)| Name | Type | Description |
|---|---|---|
k | uint32_t | the key to press |
lv_test_key_release
Release the previously press key. This function doesn't wait, but just changes the state and returns immediately.
void lv_test_key_release(void)lv_test_key_hit
Emulate a key hit. First set the released state, wait a little, press, wait, and release again. The wait time is 50ms. Internally lv_timer_handler is called, meaning all the events will be fired inside this function.
void lv_test_key_hit(uint32_t k)| Name | Type | Description |
|---|---|---|
k | uint32_t | the key to hit |
lv_test_encoder_add_diff
Emulate encoder rotation, use positive parameter to rotate to the right and negative to rotate to the left. This function doesn't wait, but just changes the state and returns immediately.
void lv_test_encoder_add_diff(int32_t d)| Name | Type | Description |
|---|---|---|
d | int32_t | number of encoder ticks to emulate |
lv_test_encoder_turn
Emulate an encoder turn a wait 50ms. Use positive parameter to rotate to the right and negative to rotate to the left. Internally lv_timer_handler is called, meaning all the events will be fired inside this function.
void lv_test_encoder_turn(int32_t d)| Name | Type | Description |
|---|---|---|
d | int32_t | number of encoder ticks to emulate |
lv_test_encoder_press
Emulate an encoder press. This function doesn't wait, but just changes the state and returns immediately.
void lv_test_encoder_press(void)lv_test_encoder_release
Emulate an encoder release. This function doesn't wait, but just changes the state and returns immediately.
void lv_test_encoder_release(void)lv_test_encoder_click
Emulate am encoder click. First set the released state, wait a little, press, wait, and release again. The wait time is 50ms. Internally lv_timer_handler is called, meaning all the events will be fired inside this function.
void lv_test_encoder_click(void)Dependencies
Last updated on