Manually sending events to keyboard widget?


What is the correct method to manually send events to a keyboard widget as detailed here:

I am trying to simulate an encoder behaviour, without using an lvgl input device.

I was able to send an event to the keyboard widget using:

uint32_t btn_id = 0;
lv_event_send(kb, LV_EVENT_VALUE_CHANGED, &btn_id);

but it seems the button is not active.

So I added a call to:

lv_btnm_set_pressed(kb, btn_id);

This does show the keyboard button in the pressed state, but that’s it, the LV_EVENT_VALUE_CHANGED event doesn’t cause the button value to be entered in the associated text area.

Also, I am not sure how this maps to LV_KEY_ENTER/LEFT/RIGHT events normally sent by an encoder…

Does anyone have an example of sending direct events to a keyboard or button matrix widget?

What LVGL version are you using?