From: Wonkeun Oh Date: Tue, 14 Feb 2017 07:27:50 +0000 (+0900) Subject: Added the logic to change the keyboard mode from H/W mode to S/W mode by remote control X-Git-Tag: accepted/tizen/3.0/common/20170217.122021~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=88b917d058743ba95a72cb52661d3c7c4a9122a1;p=platform%2Fcore%2Fuifw%2Fisf.git Added the logic to change the keyboard mode from H/W mode to S/W mode by remote control Change-Id: Ia7c827c7221b6fd835b53be824d1451724d66053 --- diff --git a/ism/extras/wayland_immodule/wayland_imcontext.c b/ism/extras/wayland_immodule/wayland_imcontext.c index eb0b1e2..8ad3329 100644 --- a/ism/extras/wayland_immodule/wayland_imcontext.c +++ b/ism/extras/wayland_immodule/wayland_imcontext.c @@ -2281,6 +2281,41 @@ keyboard_mode_changed_cb (keynode_t *key, void* data) } } } + +#ifdef _TV +static Eina_Bool read_devices = EINA_FALSE; +char ** device_names = NULL; + +static Eina_Bool +filter_devices (const char *dev_name) +{ + int i; + LOGD(""); + + if (!dev_name) + return EINA_FALSE; + + if (read_devices == EINA_FALSE) { + char *devices = getenv("ISF_REMOTE_CONTROL_DEVICES"); + if (devices) { + device_names = eina_str_split(devices, ",", 0); + } + read_devices = EINA_TRUE; + } + + if (device_names == NULL) { + return EINA_FALSE; + } + + for (i = 0; device_names[i]; i++) { + if (!strcmp (dev_name, device_names[i])) { + return EINA_TRUE; + } + } + + return EINA_FALSE; +} +#endif #endif void wayland_im_initialize () @@ -2337,6 +2372,15 @@ void wayland_im_uninitialize () vconf_ignore_key_changed (VCONFKEY_AUTOCAPITAL_ALLOW_BOOL, autocapital_allow_changed_cb); vconf_ignore_key_changed (VCONFKEY_ISF_INPUT_LANGUAGE, input_language_changed_cb); vconf_ignore_key_changed (VCONFKEY_ISF_HW_KEYBOARD_INPUT_DETECTED, keyboard_mode_changed_cb); + +#ifdef _TV + if (device_names) { + if (device_names[0]) + free (device_names[0]); + free (device_names); + device_names = NULL; + } +#endif #endif if (_ime_device) { @@ -2759,6 +2803,19 @@ wayland_im_context_filter_event(Ecore_IMF_Context *ctx, return EINA_FALSE; } +#ifdef _TV + if (strcmp (ecore_key_ev.keyname, "Return") == 0 && type == ECORE_IMF_EVENT_KEY_DOWN && filter_devices (key_dev_name) && hw_keyboard_mode == EINA_TRUE) { + LOGD ("Changed keyboard mode from H/W to S/W "); + hw_keyboard_mode = EINA_FALSE; + vconf_set_bool (VCONFKEY_ISF_HW_KEYBOARD_INPUT_DETECTED, 0); + + if (ecore_imf_context_input_panel_enabled_get (ctx)) { + ecore_imf_context_input_panel_show (ctx); + } + return EINA_TRUE; + } +#endif + do { if (!ecore_key_ev.timestamp && (ecore_key_ev.modifiers & MOD_Mod5_MASK)) { if (type == ECORE_IMF_EVENT_KEY_DOWN) {