Keyboard input slow

Hello,

I’m having some issues with the performance of the keyboard matrix where there is a 0.5 second delay between every key input. If I drag my finger over the LCD, the keys react as expected without any delay. I’m running the lvgl on ESP32 in combination with 7" TFT with RA8875 over SPI. All is working as expected, the couch screen is responding as desired, the only problem is the keyboard.

I went digging to see where the bottle neck is and so far I found that in lv_keyboard.c void, lv_keyboard_def_event_cb(lv_obj_t * kb, lv_event_t event) waits for LV_EVENT_VALUE_CHANGED. In my case this only happens after a number of events occur before the next LV_EVENT_VALUE_CHANGED can happen.
For example when I press a key I get this order of events:
LV_EVENT_VALUE_CHANGED
LV_EVENT_PRESSED
LV_EVENT_PRESSING
pause for 0.5s
LV_EVENT_SHORT_CLICKED
LV_EVENT_CLICKED
LV_EVENT_RELEASED

When I drag my finger over the screen I get this order of events:
LV_EVENT_PRESSING
LV_EVENT_PRESSING
LV_EVENT_PRESSING
LV_EVENT_VALUE_CHANGED
LV_EVENT_PRESSING
LV_EVENT_PRESSING
LV_EVENT_PRESSING
LV_EVENT_VALUE_CHANGED
and so on…

I hope anyone will be able to shine some light on this because I’m stuck at this point.
Thanks in advance!

Please show the gist of your input driver implementation.

@embeddedt, thanks for your reply!

Here is the input driver:

Here is the driver registration:

Although you have probably worked around this by now I came across the same issue. My keyboard was taking ~500ms to respond to a key press on a 1024x768 display. I spent a fun afternoon working out why and this is it the result

Hi jupeos. Thanks for the info :grinning:. I actually haven’t found a solution to this problem because I got tired of it and decided to return when all is finished. I will give your fix a try and let you know.

This is the code sample of my hack

    if(sign == LV_SIGNAL_PRESSED) {
        res = LV_RES_OK;
    }else{
        /* Include the ancient signal function */
        res = ancestor_signal(btnm, sign, param);
    }

This really did the trick. Thanks :grinning: