summaryrefslogtreecommitdiff
path: root/ism
diff options
context:
space:
mode:
authorJihoon Kim <jihoon48.kim@samsung.com>2020-03-12 12:51:30 +0900
committerJihoon Kim <jihoon48.kim@samsung.com>2020-03-18 12:33:31 +0900
commit091d72a268156a14d910bb4cbeb84b91950f4e71 (patch)
treec0238a78ce5d0aae817d55cee106c160ce791420 /ism
parent362153cec2cb28bbfab3a3fa0e7725e834aa5211 (diff)
downloadisf-091d72a268156a14d910bb4cbeb84b91950f4e71.tar.gz
isf-091d72a268156a14d910bb4cbeb84b91950f4e71.tar.bz2
isf-091d72a268156a14d910bb4cbeb84b91950f4e71.zip
Handle key event cancel flag
Change-Id: I9e8af6737f90a47245ad727110d009095a7b01d3 Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
Diffstat (limited to 'ism')
-rw-r--r--ism/extras/wayland_immodule/wayland_imcontext.c42
1 files changed, 26 insertions, 16 deletions
diff --git a/ism/extras/wayland_immodule/wayland_imcontext.c b/ism/extras/wayland_immodule/wayland_imcontext.c
index 6b42aba6..8124e948 100644
--- a/ism/extras/wayland_immodule/wayland_imcontext.c
+++ b/ism/extras/wayland_immodule/wayland_imcontext.c
@@ -807,18 +807,23 @@ static Eina_Bool
key_down_filter_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
{
Ecore_Event_Key *ev = (Ecore_Event_Key *)event;
- if (!ev || !ev->keyname) return EINA_TRUE; /* the event is kept */
+ if (!ev || !ev->keyname) return ECORE_CALLBACK_PASS_ON; /* the event is kept */
Ecore_IMF_Context *active_ctx = get_using_ctx ();
- if (!active_ctx) return EINA_TRUE; /* the event is kept */
+ if (!active_ctx) return ECORE_CALLBACK_PASS_ON; /* the event is kept */
- if (check_nograb_backkey()) return EINA_TRUE; /* the event is kept */
+ if (check_nograb_backkey()) return ECORE_CALLBACK_PASS_ON; /* the event is kept */
if ((_input_panel_state == ECORE_IMF_INPUT_PANEL_STATE_SHOW ||
_input_panel_state == ECORE_IMF_INPUT_PANEL_STATE_WILL_SHOW) &&
check_hide_key(ev->keyname)) {
+ if (ev->event_flags & ECORE_EVENT_FLAG_CANCEL) {
+ SECURE_LOGD ("%s key is cancelled.", ev->keyname);
+ return ECORE_CALLBACK_PASS_ON;
+ }
+
SECURE_LOGD ("%s key is pressed.", ev->keyname);
Ecore_IMF_Event_Key_Down imf_event;
@@ -832,26 +837,31 @@ key_down_filter_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
LOGD("no focus");
SECURE_LOGD ("%s key is pressed. ret : %d", ev->keyname, filter_ret);
- return EINA_FALSE; /* the event is removed from the queue */
+ return ECORE_CALLBACK_DONE; /* the event is removed from the queue */
}
- return EINA_TRUE; /* the event is kept */
+ return ECORE_CALLBACK_PASS_ON; /* the event is kept */
}
static Eina_Bool
key_up_filter_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
{
Ecore_Event_Key *ev = (Ecore_Event_Key *)event;
- if (!ev || !ev->keyname) return EINA_TRUE; /* the event is kept */
+ if (!ev || !ev->keyname) return ECORE_CALLBACK_PASS_ON; /* the event is kept */
Ecore_IMF_Context *active_ctx = get_using_ctx ();
- if (!active_ctx) return EINA_TRUE; /* the event is kept */
+ if (!active_ctx) return ECORE_CALLBACK_PASS_ON; /* the event is kept */
- if (check_nograb_backkey()) return EINA_TRUE; /* the event is kept */
+ if (check_nograb_backkey()) return ECORE_CALLBACK_PASS_ON; /* the event is kept */
if (_input_panel_state == ECORE_IMF_INPUT_PANEL_STATE_HIDE ||
!check_hide_key(ev->keyname))
- return EINA_TRUE; /* the event is kept */
+ return ECORE_CALLBACK_PASS_ON; /* the event is kept */
+
+ if (ev->event_flags & ECORE_EVENT_FLAG_CANCEL) {
+ SECURE_LOGD ("%s key is cancelled.", ev->keyname);
+ return ECORE_CALLBACK_PASS_ON;
+ }
SECURE_LOGD ("%s key is released.", ev->keyname);
@@ -867,12 +877,12 @@ key_up_filter_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
SECURE_LOGD ("%s key is released. ret : %d", ev->keyname, filter_ret);
if (filter_ret) {
- return EINA_FALSE; /* the event is removed from the queue */
+ return ECORE_CALLBACK_DONE; /* the event is removed from the queue */
}
else {
ecore_imf_context_reset(active_ctx);
_input_panel_hide(active_ctx, EINA_TRUE);
- return EINA_FALSE; /* the event is removed from the queue */
+ return ECORE_CALLBACK_DONE; /* the event is removed from the queue */
}
}
@@ -880,7 +890,7 @@ static Eina_Bool
rotary_event_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
{
Ecore_Event_Detent_Rotate *ev = event;
- if (!ev) return EINA_TRUE;
+ if (!ev) return ECORE_CALLBACK_PASS_ON;
Ecore_IMF_Context *active_ctx = NULL;
if (_show_req_ctx)
@@ -888,10 +898,10 @@ rotary_event_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
else if (_focused_ctx)
active_ctx = _focused_ctx;
- if (!active_ctx) return EINA_TRUE;
+ if (!active_ctx) return ECORE_CALLBACK_PASS_ON;
if (_input_panel_state == ECORE_IMF_INPUT_PANEL_STATE_HIDE)
- return EINA_TRUE;
+ return ECORE_CALLBACK_PASS_ON;
ecore_imf_context_reset(active_ctx);
WaylandIMContext *imcontext = (WaylandIMContext *)ecore_imf_context_data_get(active_ctx);
@@ -908,7 +918,7 @@ rotary_event_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
if (buffer) free(buffer);
}
- return EINA_FALSE;
+ return ECORE_CALLBACK_DONE;
}
static Eina_Bool
@@ -925,7 +935,7 @@ _ecore_event_filter_cb(void *data, void *loop_data EINA_UNUSED, int type, void *
return rotary_event_cb(data, type, event);
}
- return EINA_TRUE;
+ return ECORE_CALLBACK_PASS_ON;
}
static void