Skip to content

Add support of libinput #72

Open
Open
@RobbieKhan

Description

@RobbieKhan

Hi everyone.

I have recently designed my project for Raspberry Pi Zero 2W + 3.5" SPI TFT Touch Display using fbdef and evdev.
Then I decided to switch to Rasoberry Pi 4 Model B with official RPI Touch Display 2. Here I decided to use drm and libinput. For drm mode everything was pretty straightforward:

  1. install libdrm:
    sudo apt-get install libdrm-dev
  2. switch do drm in config:
    #define LV_USE_LINUX_FBDEV 0
    #define LV_USE_LINUX_DRM 1
  3. disable X server if it is active before you start your app (only one master may present for drm):
    sudo systemctl stop lightdm

Unfortunately I had to spend some time before I figured out how I can enable libinput. Here (https://forum.lvgl.io/t/what-drm-and-libinput-library-versions-is-lvgl-expecting/18426) someone described such problem and provided solution, but for me it was much easier:

  1. install libinput
    sudo apt-get install libinput-dev
  2. switch to libinput in config:
    #define LV_USE_EVDEV 0
    #define LV_USE_LIBINPUT 1
  3. link libinput in CMakeLists.txt:
    pkg_check_modules(LIBINPUT REQUIRED libinput)
    target_include_directories(lvgl PUBLIC ${LIBINPUT_INCLUDE_DIRS})
    target_link_libraries(....... ${LIBDRM_LIBRARIES} ${LIBINPUT_LIBRARIES} .......)
  4. add its support to your code too as described here https://docs.lvgl.io/master/details/integration/driver/libinput.html

I hope it will help to some newbies like me. And I think it would be a great idea to add libinput linking to CMakeLists.txt in that repo and additional instructions for that.
Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions