From 5353dae0274b912ae2bbe7acd19e6ac16c16863a Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Fri, 19 Apr 2019 07:37:54 +0200 Subject: [PATCH] lv_kb: fix sending APPLY and CANCEL events --- src/lv_objx/lv_kb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lv_objx/lv_kb.c b/src/lv_objx/lv_kb.c index bb0279ab9..0e54a6baf 100644 --- a/src/lv_objx/lv_kb.c +++ b/src/lv_objx/lv_kb.c @@ -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); return; } 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); } else { 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; } 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); else lv_kb_set_ta(kb, NULL); /*De-assign the text area to hide it cursor if needed*/