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.

参数:

device -- the libinput device to query

返回:

the supported input capabilities

char *lv_libinput_find_dev(lv_libinput_capability capabilities, bool force_rescan)

Find connected input device with specific capabilities

参数:
  • capabilities -- required device capabilities

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

返回:

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

参数:
  • 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

返回:

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

参数:
  • type -- LV_INDEV_TYPE_POINTER or LV_INDEV_TYPE_KEYPAD

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

返回:

pointer to input device or NULL if opening failed

void lv_libinput_delete(lv_indev_t *indev)

Delete a libinput input device

参数:

indev -- pointer to input device