| 50 | } |
| 51 | |
| 52 | void GuiService::keyboardAddTextArea(lv_obj_t* textarea) { |
| 53 | lock(); |
| 54 | |
| 55 | if (isStarted) { |
| 56 | check(lvgl::lock(0), "lvgl should already be locked before calling this method"); |
| 57 | |
| 58 | if (softwareKeyboardIsEnabled()) { |
| 59 | lv_obj_add_event_cb(textarea, show_keyboard, LV_EVENT_FOCUSED, nullptr); |
| 60 | lv_obj_add_event_cb(textarea, hide_keyboard, LV_EVENT_DEFOCUSED, nullptr); |
| 61 | lv_obj_add_event_cb(textarea, hide_keyboard, LV_EVENT_READY, nullptr); |
| 62 | |
| 63 | // lv_obj_t auto-remove themselves from the group when they are destroyed (last checked in LVGL 8.3) |
| 64 | lv_group_add_obj(keyboardGroup, textarea); |
| 65 | |
| 66 | lvgl::software_keyboard_activate(keyboardGroup); |
| 67 | } |
| 68 | |
| 69 | lvgl::unlock(); |
| 70 | } |
| 71 | |
| 72 | unlock(); |
| 73 | } |
| 74 | |
| 75 | } // namespace |
no test coverage detected