Modify 'Return' key handling regarding the keyboard mode 94/172694/1
authorSungmin Kwak <sungmin.kwak@samsung.com>
Wed, 14 Mar 2018 08:22:49 +0000 (17:22 +0900)
committerSungmin Kwak <sungmin.kwak@samsung.com>
Thu, 15 Mar 2018 07:32:07 +0000 (16:32 +0900)
In Tv specific, the keyboard mode should be changed to SW by remocon 'Return' key.
For the correct behavior, give the key to IME first then handle the keyboard mode.
Change-Id: I3344a5d248d4a2f980b9ca571f4e0fc989dc0263

ism/extras/wayland_immodule/wayland_imcontext.c

index 0a917ef..6a75c03 100644 (file)
@@ -3141,25 +3141,6 @@ wayland_im_context_filter_event(Ecore_IMF_Context    *ctx,
             return EINA_FALSE;
         }
 
-        if (_TV) {
-            if (strcmp (ecore_key_ev.keyname, "Return") == 0 && type == ECORE_IMF_EVENT_KEY_DOWN && key_dev_subclass == ECORE_DEVICE_SUBCLASS_REMOCON) {
-                int val;
-
-                if (vconf_get_bool (VCONFKEY_ISF_HW_KEYBOARD_INPUT_DETECTED, &val) == 0) {
-                    if (val) {
-                        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;
-                    }
-                }
-            }
-        }
-
         do {
             if (!ecore_key_ev.timestamp && (ecore_key_ev.modifiers & MOD_Mod5_MASK)
                 && key_dev_subclass == ECORE_DEVICE_SUBCLASS_VIRTUAL_KEYBOARD) {
@@ -3212,6 +3193,22 @@ wayland_im_context_filter_event(Ecore_IMF_Context    *ctx,
 
         if (type == ECORE_IMF_EVENT_KEY_DOWN) {
             if (ret == EINA_FALSE) {
+                if (_TV) {
+                    if (strcmp (ecore_key_ev.keyname, "Return") == 0 && key_dev_subclass == ECORE_DEVICE_SUBCLASS_REMOCON) {
+                        int val;
+                        if (vconf_get_bool (VCONFKEY_ISF_HW_KEYBOARD_INPUT_DETECTED, &val) == 0) {
+                            if (val) {
+                                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;
+                            }
+                        }
+                    }
+                }
                 if (strcmp (ecore_key_ev.key, "space") == 0 ||
                     strcmp (ecore_key_ev.key, "KP_Space") == 0) {
                     autoperiod_insert (ctx);