lv_evdev.h

Functions

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

Create evdev 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_evdev_set_swap_axes(lv_indev_t *indev, bool swap_axes)

Set whether coordinates of pointer device should be swapped. Defaults to false.

Parameters:
  • indev -- evdev input device

  • swap_axes -- whether to swap x and y axes

void lv_evdev_set_calibration(lv_indev_t *indev, int min_x, int min_y, int max_x, int max_y)

Configure a coordinate transformation for pointer devices. Applied after axis swap, if any. Defaults to apply no transformation.

Parameters:
  • indev -- evdev input device

  • min_x -- pointer coordinate mapped to min x of display

  • min_y -- pointer coordinate mapped to min y of display

  • max_x -- pointer coordinate mapped to max x of display

  • max_y -- pointer coordinate mapped to max y of display

void lv_evdev_delete(lv_indev_t *indev)

Remove evdev input device.

Parameters:

indev -- evdev input device to close and free