lv_evdev.h
API reference for lv_evdev.h
Functions
lv_evdev_set_swap_axes
Set whether coordinates of pointer device should be swapped. Defaults to false.
void lv_evdev_set_swap_axes(lv_indev_t *indev, bool swap_axes)| Name | Type | Description |
|---|---|---|
indev | lv_indev_t * | evdev input device |
swap_axes | bool | whether to swap x and y axes |
lv_evdev_set_calibration
Configure a coordinate transformation for pointer devices. Applied after axis swap, if any. Defaults to apply no transformation.
void lv_evdev_set_calibration(lv_indev_t *indev, int min_x, int min_y, int max_x, int max_y)| Name | Type | Description |
|---|---|---|
indev | lv_indev_t * | evdev input device |
min_x | int | pointer coordinate mapped to min x of display |
min_y | int | pointer coordinate mapped to min y of display |
max_x | int | pointer coordinate mapped to max x of display |
max_y | int | pointer coordinate mapped to max y of display |
lv_evdev_get_raw_key
Returns the raw keycode if LV_KEY could not be processed
uint16_t lv_evdev_get_raw_key(lv_event_t *e)| Name | Type | Description |
|---|---|---|
e | lv_event_t * | pointer to an event |
Returns: uint16_t — uint16_t raw keycode
lv_evdev_create
Create evdev input device from a given path.
lv_indev_t * lv_evdev_create(lv_indev_type_t indev_type, const char *dev_path)| Name | Type | Description |
|---|---|---|
indev_type | lv_indev_type_t | LV_INDEV_TYPE_POINTER or LV_INDEV_TYPE_KEYPAD |
dev_path | const char * | device path, e.g., /dev/input/event0 |
Returns: lv_indev_t * — pointer to input device or NULL if opening failed
lv_evdev_create_fd
Create evdev input device, taking ownership of the given file descriptor.
lv_indev_t * lv_evdev_create_fd(lv_indev_type_t indev_type, int fd)| Name | Type | Description |
|---|---|---|
indev_type | lv_indev_type_t | LV_INDEV_TYPE_POINTER or LV_INDEV_TYPE_KEYPAD |
fd | int | file descriptor of the evdev device |
Returns: lv_indev_t * — pointer to input device or NULL if opening failed
lv_evdev_discovery_start
Begin automatically creating evdev indevs for all new and existing evdev devices found in /dev/input/
lv_result_t lv_evdev_discovery_start(lv_evdev_discovery_cb_t cb, void *user_data)| Name | Type | Description |
|---|---|---|
cb | lv_evdev_discovery_cb_t | function to call when a new evdev indev is discovered, or NULL |
user_data | void * | parameter to pass to the callback May be NULL. |
Returns: lv_result_t — the success or failure status. It will fail if it's already running or resources could not be initialized.
lv_evdev_discovery_stop
Stop automatically creating evdev indevs. Safe to call from the discovery callback.
lv_result_t lv_evdev_discovery_stop(void)Returns: lv_result_t — the success or failure status. It will fail if it's already running.
lv_evdev_is_raw_key
Returns the status indicating whether an LV_KEY could not be processed.
bool lv_evdev_is_raw_key(lv_event_t *e)| Name | Type | Description |
|---|---|---|
e | lv_event_t * | pointer to an event |
Returns: bool — false if it is not a raw key
lv_evdev_delete
Remove evdev input device.
void lv_evdev_delete(lv_indev_t *indev)| Name | Type | Description |
|---|---|---|
indev | lv_indev_t * | evdev input device to close and free May be NULL. |
Enums
lv_evdev_type_t
| Name | Description |
|---|---|
LV_EVDEV_TYPE_REL | mice |
LV_EVDEV_TYPE_ABS | touch screens, mousepads |
LV_EVDEV_TYPE_KEY | keyboards, keypads, buttons |
Typedefs
lv_evdev_discovery_cb_t
typedef void(* lv_evdev_discovery_cb_t) (lv_indev_t *indev, lv_evdev_type_t type, void *user_data)Used by 1 function
lv_evdev_discovery_start— paramcb
Dependencies
Last updated on