Tried this handler added to the keyboard:
lv_obj_add_event_cb(ui_PopupKeyboard, KeyboardPopup_KeyPressed, LV_EVENT_VALUE_CHANGED, NULL);
But this handler produces no meaningful data reflecting the key pressed:
void KeyboardPopup_KeyPressed(lv_event_t *e)
{
auto key = lv_indev_get_key(lv_indev_get_act());
Serial.println(key);
Serial.println(e->code);
Serial.println(int(e->user_data));
}
In case it useful to anyone, I finally pieced together how to get the keyboard values:
void KeyboardPopup_KeyPressed(lv_event_t *e)
{
auto key = lv_keyboard_get_selected_btn(ui_PopupKeyboard);
auto button = lv_keyboard_get_btn_text(ui_PopupKeyboard, key);
Serial.print(key);
Serial.print(" | ");
Serial.println(button);
}
I struggled for about an hour but here’s how I got it to hide. Either defocus from the textarea or press the checkmark on the keyboard. BEWARE: if you are using “focused” for opening the keyboard, the checkmark will close the keyboard but the textarea will remain focused until you defocus. To change that, you can set the show trigger to pressed.
1 Like
Had, the same problem, this solved it
Thanks!
1 Like