Long press in external button is not working

Description

I’m able to link my external key button as input device to lvgl library. I can detect the press and release status. My agenda is to detect the short and long press.

What have you tried so far?

static void button_read(lv_indev_drv_t * drv, lv_indev_data_t * data)
{
int btn_pr = my_btn_read();
if(btn_pr >= 0)
{
last_btn = btn_pr;
data->state = LV_INDEV_STATE_PRESSED;
}
else
{
data->state = LV_INDEV_STATE_RELEASED;
}

data->btn_id = last_btn;

}

How can I add long press and short press events?

Link to the code: https://components.espressif.com/components/espressif/esp_lvgl_port

It has what you need.

Thanks for your response @Stipa889, however I have raised an issue here - Long press in LV_INDEV, data->state · Issue #5945 · lvgl/lvgl (github.com)