Get touch coordinates from Input device

Hello,

I am trying to get the coordinates of the point on the screen that I touched last time.
I think this can be done with Input device Interface but it does not work at the moment.
I would like this to work with in event mode (not polling).

Ideally I would touch the screen and at a later point, I can read back the coordinates of this touch.

What MCU/Processor/Board and compiler are you using?

EK-RA8D1

What LVGL version are you using?

master (latest)

What do you want to achieve?

What have you tried so far?

lv_indev_t * indev= lv_indev_create();
lv_indev_set_type(indev, LV_INDEV_TYPE_POINTER);
lv_indev_set_mode(indev, LV_INDEV_MODE_EVENT);

lv_indev_set_read_cb(indev, read_cb);

But read_cb never gets triggered when I touch the screen. What do I miss ?

Thanks and regards

Hello,

The callback does not get called periodically in event mode. See the documentation:

https://docs.lvgl.io/master/porting/indev.html#switching-the-input-device-to-event-driven-mode

You will have to call lv_indev_read(indev) instead to get LVGL to do anything with your coordinates. If I understand correctly, using lv_indev_read will call your callback.