From ca82f24ba3ec6006a7112b73cc5118d7f69f9e71 Mon Sep 17 00:00:00 2001 From: jeon Date: Wed, 22 Jul 2020 19:30:16 +0900 Subject: [PATCH] e_keyrouter: Support a API to send event_surface Change-Id: I16be5141433d3d082fda7182d0f57fd39eb42642 --- src/bin/e_comp_wl.c | 2 ++ src/bin/e_keyrouter.c | 11 +++++++++++ src/bin/e_keyrouter.h | 2 ++ src/bin/e_keyrouter_private.h | 2 ++ src/bin/e_keyrouter_wl.c | 6 +++--- 5 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c index d271929c95..dd38752e2e 100644 --- a/src/bin/e_comp_wl.c +++ b/src/bin/e_comp_wl.c @@ -5167,6 +5167,7 @@ e_comp_wl_key_send(E_Client *ec, int keycode, Eina_Bool pressed, Ecore_Device *d else state = WL_KEYBOARD_KEY_STATE_RELEASED; comp_conf = e_comp_config_get(); + e_keyrouter_event_surface_send(ec, keycode); EINA_LIST_FOREACH(e_comp_wl->kbd.resources, l, res) { @@ -5215,6 +5216,7 @@ e_comp_wl_key_cancel(E_Client *ec, int keycode, Ecore_Device *dev, uint32_t time if (!time) time = (uint32_t)(ecore_time_get() * 1000); comp_conf = e_comp_config_get(); + e_keyrouter_event_surface_send(ec, keycode); EINA_LIST_FOREACH(e_comp_wl->kbd.resources, l, res) { diff --git a/src/bin/e_keyrouter.c b/src/bin/e_keyrouter.c index bba5e54bf8..cac1ef6279 100644 --- a/src/bin/e_keyrouter.c +++ b/src/bin/e_keyrouter.c @@ -571,6 +571,17 @@ e_keyrouter_composition_key_del(int *keys, int count) KLINF("Delete %d and %d key composition.\n", keys[0], keys[1]); } +E_API void +e_keyrouter_event_surface_send(E_Client *ec, int key) +{ + EINA_SAFETY_ON_NULL_RETURN(krt); + EINA_SAFETY_ON_NULL_RETURN(ec); + EINA_SAFETY_ON_NULL_RETURN(ec->comp_data); + EINA_SAFETY_ON_NULL_RETURN(ec->comp_data->surface); + key = key - 8; + + e_keyrouter_wl_event_surface_send(ec->comp_data->surface, key, TIZEN_KEYROUTER_MODE_NONE); +} E_API int e_keyrouter_init(void) diff --git a/src/bin/e_keyrouter.h b/src/bin/e_keyrouter.h index c6b2a4ff6a..ebc2c30129 100644 --- a/src/bin/e_keyrouter.h +++ b/src/bin/e_keyrouter.h @@ -137,6 +137,8 @@ E_API void e_keyrouter_longkey_del(int keycode); E_API int e_keyrouter_composition_key_add(int *keys, int count); E_API void e_keyrouter_composition_key_del(int *keys, int count); +E_API void e_keyrouter_event_surface_send(E_Client *ec, int key); + #endif #endif diff --git a/src/bin/e_keyrouter_private.h b/src/bin/e_keyrouter_private.h index 5bba5937c8..c775f3f05f 100644 --- a/src/bin/e_keyrouter_private.h +++ b/src/bin/e_keyrouter_private.h @@ -130,3 +130,5 @@ Eina_Bool e_keyrouter_event_process(void *event, int type); Eina_Bool e_keyrouter_wl_key_send(Ecore_Event_Key *ev, Eina_Bool pressed, struct wl_client *client, struct wl_resource *surface, Eina_Bool focused); void e_keyrouter_keycancel_send(struct wl_client *client, struct wl_resource *surface, unsigned int key); +void e_keyrouter_wl_event_surface_send(struct wl_resource *surface, int key, int mode); + diff --git a/src/bin/e_keyrouter_wl.c b/src/bin/e_keyrouter_wl.c index 01cde31225..57cf32abb3 100644 --- a/src/bin/e_keyrouter_wl.c +++ b/src/bin/e_keyrouter_wl.c @@ -1,7 +1,7 @@ #include "e_keyrouter_private.h" -static void -_e_keyrouter_event_surface_send(struct wl_resource *surface, int key, int mode) +void +e_keyrouter_wl_event_surface_send(struct wl_resource *surface, int key, int mode) { Eina_List *l; struct wl_resource *res_data; @@ -39,7 +39,7 @@ _e_keyrouter_wl_key_send(Ecore_Event_Key *ev, enum wl_keyboard_key_state state, if (surface && !focused) { - _e_keyrouter_event_surface_send(surface, ev->keycode, TIZEN_KEYROUTER_MODE_NONE); + e_keyrouter_wl_event_surface_send(surface, ev->keycode, TIZEN_KEYROUTER_MODE_NONE); } EINA_LIST_FOREACH(key_list, l, res) -- 2.34.1