kb: event fix

This commit is contained in:
Gabor Kiss-Vamosi
2019-04-27 10:59:22 +02:00
parent 8dc2b36bf7
commit 630199d9a3

View File

@@ -350,17 +350,21 @@ void lv_kb_def_event_cb(lv_obj_t * kb, lv_event_t event)
return; return;
} else if(strcmp(txt, LV_SYMBOL_CLOSE) == 0) { } else if(strcmp(txt, LV_SYMBOL_CLOSE) == 0) {
if(kb->event_cb != lv_kb_def_event_cb) { if(kb->event_cb != lv_kb_def_event_cb) {
lv_event_send(kb, LV_EVENT_CANCEL, NULL); lv_res_t res = lv_event_send(kb, LV_EVENT_CANCEL, NULL);
if(res != LV_RES_OK) return;
} else { } else {
lv_kb_set_ta(kb, NULL); /*De-assign the text area to hide it cursor if needed*/ lv_kb_set_ta(kb, NULL); /*De-assign the text area to hide it cursor if needed*/
lv_obj_del(kb); lv_obj_del(kb);
} }
return; return;
} else if(strcmp(txt, LV_SYMBOL_OK) == 0) { } else if(strcmp(txt, LV_SYMBOL_OK) == 0) {
if(kb->event_cb != lv_kb_def_event_cb) if(kb->event_cb != lv_kb_def_event_cb) {
lv_event_send(kb, LV_EVENT_APPLY, NULL); lv_res_t res = lv_event_send(kb, LV_EVENT_APPLY, NULL);
else if(res != LV_RES_OK) return;
}
else {
lv_kb_set_ta(kb, NULL); /*De-assign the text area to hide it cursor if needed*/ lv_kb_set_ta(kb, NULL); /*De-assign the text area to hide it cursor if needed*/
}
return; return;
} }