lv_libinput.h

Defines

LV_LIBINPUT_MAX_EVENTS

Enums

enum lv_libinput_capability

Values:

enumerator LV_LIBINPUT_CAPABILITY_NONE
enumerator LV_LIBINPUT_CAPABILITY_KEYBOARD
enumerator LV_LIBINPUT_CAPABILITY_POINTER
enumerator LV_LIBINPUT_CAPABILITY_TOUCH

Functions

lv_libinput_capability lv_libinput_query_capability(struct libinput_device *device)

Determine the capabilities of a specific libinput device.

Parameters:

device -- the libinput device to query

Returns:

the supported input capabilities

char *lv_libinput_find_dev(lv_libinput_capability capabilities, bool force_rescan)

Find connected input device with specific capabilities

Parameters:
  • capabilities -- required device capabilities

  • force_rescan -- erase the device cache (if any) and rescan the file system for available devices

Returns:

device node path (e.g. /dev/input/event0) for the first matching device or NULL if no device was found. The pointer is safe to use until the next forceful device search.

size_t lv_libinput_find_devs(lv_libinput_capability capabilities, char **found, size_t count, bool force_rescan)

Find connected input devices with specific capabilities

Parameters:
  • capabilities -- required device capabilities

  • devices -- pre-allocated array to store the found device node paths (e.g. /dev/input/event0). The pointers are safe to use until the next forceful device search.

  • count -- maximum number of devices to find (the devices array should be at least this long)

  • force_rescan -- erase the device cache (if any) and rescan the file system for available devices

Returns:

number of devices that were found

lv_indev_t *lv_libinput_create(lv_indev_type_t indev_type, const char *dev_path)

Create a new libinput input device

Parameters:
  • type -- LV_INDEV_TYPE_POINTER or LV_INDEV_TYPE_KEYPAD

  • dev_path -- device path, e.g. /dev/input/event0

Returns:

pointer to input device or NULL if opening failed

void lv_libinput_delete(lv_indev_t *indev)

Delete a libinput input devic

Parameters:

indev -- pointer to input device

struct lv_libinput_event_t

Public Members

lv_indev_state_t pressed
int key_val
lv_point_t point
struct lv_libinput_t

Public Members

int fd
struct pollfd fds[1]
lv_libinput_event_t points[32]
lv_libinput_event_t slots[2]
lv_point_t pointer_position
bool pointer_button_down
int start
int end
lv_libinput_event_t last_event
bool deinit
pthread_mutex_t event_lock
pthread_t worker_thread
struct libinput *libinput_context
struct libinput_device *libinput_device