mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-14 06:42:58 +08:00
lv_kb: fix sending APPLY and CANCEL events
This commit is contained in:
parent
850693a840
commit
5353dae027
@ -344,7 +344,7 @@ void lv_kb_def_event_cb(lv_obj_t * kb, lv_event_t event)
|
|||||||
lv_btnm_set_ctrl_map(kb, kb_ctrl_spec_map);
|
lv_btnm_set_ctrl_map(kb, kb_ctrl_spec_map);
|
||||||
return;
|
return;
|
||||||
} else if(strcmp(txt, LV_SYMBOL_CLOSE) == 0) {
|
} else if(strcmp(txt, LV_SYMBOL_CLOSE) == 0) {
|
||||||
if(kb->event_cb) {
|
if(kb->event_cb != lv_kb_def_event_cb) {
|
||||||
lv_event_send(kb, LV_EVENT_CANCEL, NULL);
|
lv_event_send(kb, LV_EVENT_CANCEL, NULL);
|
||||||
} 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*/
|
||||||
@ -352,7 +352,7 @@ void lv_kb_def_event_cb(lv_obj_t * kb, lv_event_t event)
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
} else if(strcmp(txt, LV_SYMBOL_OK) == 0) {
|
} else if(strcmp(txt, LV_SYMBOL_OK) == 0) {
|
||||||
if(kb->event_cb)
|
if(kb->event_cb != lv_kb_def_event_cb)
|
||||||
lv_event_send(kb, LV_EVENT_APPLY, NULL);
|
lv_event_send(kb, LV_EVENT_APPLY, NULL);
|
||||||
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*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user