# lv_libinput.h (/api/drivers/libinput/lv_libinput_h)



<RelatedHeaders name="lv_libinput_private.h" isPrivate="false" />

<ApiSummary functions="5" enums="1" macros="1" />

Functions [#functions]

<ApiMember kind="function" name="lv_libinput_query_capability" file="drivers/libinput/lv_libinput.h" line="55" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/drivers/libinput/lv_libinput.h#L55">
  lv_libinput_query_capability [#lv_libinput_query_capability]

  Determine the capabilities of a specific libinput device.

  ```c title=" " lineNumbers=1
  lv_libinput_capability lv_libinput_query_capability(struct libinput_device *device)
  ```

  <span className="sr-only">
    Parameters
  </span>

  | Name     | Type                       | Description                  |
  | -------- | -------------------------- | ---------------------------- |
  | `device` | `struct libinput_device *` | the libinput device to query |

  **Returns:** <ApiLink name="lv_libinput_capability" /> — the supported input capabilities
</ApiMember>

<ApiMember kind="function" name="lv_libinput_find_dev" file="drivers/libinput/lv_libinput.h" line="64" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/drivers/libinput/lv_libinput.h#L64">
  lv_libinput_find_dev [#lv_libinput_find_dev]

  Find connected input device with specific capabilities

  ```c title=" " lineNumbers=1
  char * lv_libinput_find_dev(lv_libinput_capability capabilities, bool force_rescan)
  ```

  <span className="sr-only">
    Parameters
  </span>

  | Name           | Type                                      | Description                                                                      |
  | -------------- | ----------------------------------------- | -------------------------------------------------------------------------------- |
  | `capabilities` | <ApiLink name="lv_libinput_capability" /> | required device capabilities                                                     |
  | `force_rescan` | <ApiLink name="bool" />                   | erase the device cache (if any) and rescan the file system for available devices |

  **Returns:** `char *` — 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.
</ApiMember>

<ApiMember kind="function" name="lv_libinput_find_devs" file="drivers/libinput/lv_libinput.h" line="75" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/drivers/libinput/lv_libinput.h#L75">
  lv_libinput_find_devs [#lv_libinput_find_devs]

  Find connected input devices with specific capabilities

  ```c title=" " lineNumbers=1
  size_t lv_libinput_find_devs(lv_libinput_capability capabilities, char **found, size_t count, bool force_rescan)
  ```

  <span className="sr-only">
    Parameters
  </span>

  | Name           | Type                                      | Description                                                                        |
  | -------------- | ----------------------------------------- | ---------------------------------------------------------------------------------- |
  | `capabilities` | <ApiLink name="lv_libinput_capability" /> | required device capabilities                                                       |
  | `found`        | `char **`                                 |                                                                                    |
  | `count`        | <ApiLink name="size_t" />                 | maximum number of devices to find (the devices array should be at least this long) |
  | `force_rescan` | <ApiLink name="bool" />                   | erase the device cache (if any) and rescan the file system for available devices   |

  **Returns:** <ApiLink name="size_t" /> — number of devices that were found
</ApiMember>

<ApiMember kind="function" name="lv_libinput_create" file="drivers/libinput/lv_libinput.h" line="83" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/drivers/libinput/lv_libinput.h#L83">
  lv_libinput_create [#lv_libinput_create]

  Create a new libinput input device

  ```c title=" " lineNumbers=1
  lv_indev_t * lv_libinput_create(lv_indev_type_t indev_type, const char *dev_path)
  ```

  <span className="sr-only">
    Parameters
  </span>

  | Name         | Type                               | Description                         |
  | ------------ | ---------------------------------- | ----------------------------------- |
  | `indev_type` | <ApiLink name="lv_indev_type_t" /> |                                     |
  | `dev_path`   | `const char *`                     | device path, e.g. /dev/input/event0 |

  **Returns:** <ApiLink name="lv_indev_t" display="lv_indev_t *" /> — pointer to input device or NULL if opening failed
</ApiMember>

<ApiMember kind="function" name="lv_libinput_delete" file="drivers/libinput/lv_libinput.h" line="89" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/drivers/libinput/lv_libinput.h#L89">
  lv_libinput_delete [#lv_libinput_delete]

  Delete a libinput input device

  ```c title=" " lineNumbers=1
  void lv_libinput_delete(lv_indev_t *indev)
  ```

  <span className="sr-only">
    Parameters
  </span>

  | Name    | Type                                                 | Description             |
  | ------- | ---------------------------------------------------- | ----------------------- |
  | `indev` | <ApiLink name="lv_indev_t" display="lv_indev_t *" /> | pointer to input device |
</ApiMember>

Enums [#enums]

<ApiMember kind="enum" name="lv_libinput_capability" file="drivers/libinput/lv_libinput.h" line="35" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/drivers/libinput/lv_libinput.h#L35">
  lv_libinput_capability [#lv_libinput_capability]

  | Name                              | Value     |
  | --------------------------------- | --------- |
  | `LV_LIBINPUT_CAPABILITY_NONE`     | `0`       |
  | `LV_LIBINPUT_CAPABILITY_KEYBOARD` | `1U << 0` |
  | `LV_LIBINPUT_CAPABILITY_POINTER`  | `1U << 1` |
  | `LV_LIBINPUT_CAPABILITY_TOUCH`    | `1U << 2` |
</ApiMember>

<TypeUsedBy name="lv_libinput_capability" count="2">
  * `lv_libinput_find_dev` — param `capabilities`
  * `lv_libinput_find_devs` — param `capabilities`
</TypeUsedBy>

Macros [#macros]

<ApiMember kind="macro" name="LV_LIBINPUT_MAX_EVENTS" file="drivers/libinput/lv_libinput.h" line="44" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/drivers/libinput/lv_libinput.h#L44">
  LV_LIBINPUT_MAX_EVENTS [#lv_libinput_max_events]

  ```c title=" " lineNumbers=1
  #define LV_LIBINPUT_MAX_EVENTS 32
  ```
</ApiMember>

Dependencies [#dependencies]

<FileIncludes includes="[&#x22;lv_indev.h&#x22;, &#x22;poll.h&#x22;, &#x22;pthread.h&#x22;]" includedBy="[&#x22;lv_libinput_private.h&#x22;, &#x22;lv_drivers.h&#x22;]" transitiveIncludes="[&#x22;lv_area.h&#x22;, &#x22;lv_array.h&#x22;, &#x22;lv_conf_internal.h&#x22;, &#x22;lv_conf_kconfig.h&#x22;, &#x22;lv_event.h&#x22;, &#x22;lv_group.h&#x22;, &#x22;lv_ll.h&#x22;, &#x22;lv_math.h&#x22;, &#x22;lv_tick.h&#x22;, &#x22;lv_timer.h&#x22;, &#x22;lv_types.h&#x22;]" />
