Simplest C example for fbdev and evdev (no SDL)?

If you have the evdev driver enabled, this code needs to be present when you initialize LittlevGL:

    evdev_init();
    lv_indev_drv_t indev_drv;
    lv_indev_drv_init(&indev_drv);
    indev_drv.type = LV_INDEV_TYPE_POINTER;
    indev_drv.read_cb = evdev_read;
    lv_indev_drv_register(&indev_drv);

After that, you can create buttons or other widgets as per the examples and they automatically get touchscreen input. If you want a simple example with one button you can take a look at the button documentation.

1 Like