Revert "Added hotkey support" 36/169436/2
authorJi-hoon Lee <dalton.lee@samsung.com>
Tue, 6 Feb 2018 06:50:58 +0000 (15:50 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Tue, 6 Feb 2018 23:51:13 +0000 (08:51 +0900)
This reverts commit 3bb53cbf4a129959e435ae25811f6594398bb580.

Conflicts:
src/e_mod_main.c

Change-Id: Ia484f9fd171bbed6852827898d1ddfc157f8eb88

src/e_mod_main.c

index 5d0e149..7a4a3ab 100644 (file)
@@ -114,14 +114,6 @@ struct _E_Mod_Text_Input_Shutdown_Cb
    void *data;
 };
 
-struct _E_Input_Method_Keymap_Info
-{
-   const char *language;
-   const char *rules;
-   const char *models;
-   const char *layout;
-};
-
 /* This represents the overall input panel's state including the candidate area */
 enum _E_Input_Panel_State
 {
@@ -140,8 +132,6 @@ static Eeze_Udev_Watch *eeze_udev_watch_hander = NULL;
 static Ecore_Event_Handler *ecore_key_down_handler = NULL;
 static Eina_List *handlers = NULL;
 static uint32_t g_text_input_count = 1;
-static uint32_t g_keymap_index = 0;
-static Eina_Bool g_keyboard_mode_engligh = EINA_TRUE;
 static Ecore_Timer *g_timer_will_hide  = NULL;
 static enum _E_Input_Panel_State g_input_panel_state = E_INPUT_PANEL_STATE_DID_HIDE;
 static E_Client *client_surface_ec = NULL;
@@ -167,11 +157,6 @@ const int WILL_HIDE_TIMER_INTERVAL = 1.0f;
     }                                     \
   while (0)
 
-static struct _E_Input_Method_Keymap_Info g_keymap_info[] = {
-   {"en_US", "evdev", "pc105", "us"},
-   {"ru_RU", "evdev", "pc105", "ru"},
-};
-
 static void _e_text_input_cb_input_panel_show(struct wl_client *client, struct wl_resource *resource);
 static void _e_text_input_deactivate(E_Text_Input *text_input, E_Input_Method *input_method, Eina_Bool need_focus_in);
 static Eina_Bool _e_text_input_method_create_context(struct wl_client *client, E_Input_Method *input_method, E_Text_Input *text_input, Eina_Bool need_focus_out);
@@ -347,34 +332,6 @@ _keyboard_mode_changed_cb(keynode_t *key, void* data)
      }
 }
 
-static void
-_display_language_changed_cb(keynode_t *key, void* data)
-{
-   int loop;
-   char *language = vconf_keynode_get_str(key);
-   LOGD("language : %s\n", language);
-
-   /* Just in case we did not find any matching language string */
-   g_keymap_index = 0;
-   if (language)
-     {
-        for (loop = 0; loop < sizeof(g_keymap_info) / sizeof(struct _E_Input_Method_Keymap_Info); loop++)
-          {
-             if (strncmp(language, g_keymap_info[loop].language, strlen(g_keymap_info[loop].language)) == 0)
-               {
-                  g_keymap_index = loop;
-               }
-          }
-     }
-   /* We do not want to change the current keymap related behavior in TV profile for now */
-   if (!_TV)
-     {
-        /* Resetting the H/W keyboard language mode to English, would be more appropriate when the
-         * display language gets changed, such as the cases like changing from French to Russian, for example */
-        e_comp_wl_input_keymap_set(g_keymap_info[0].rules, g_keymap_info[0].models, g_keymap_info[0].layout, NULL, NULL, NULL, NULL);
-     }
-   g_keyboard_mode_engligh = EINA_TRUE;
-}
 
 #if ENABLE_GRAB_KEYBOARD
 static void
@@ -438,40 +395,12 @@ _e_text_input_method_context_key_send(E_Input_Method_Context *context, unsigned
 }
 
 static Eina_Bool
-_e_text_input_method_context_filter_hotkeys(E_Input_Method_Context *context, Ecore_Event_Key *ev)
-{
-   if (!ev) return EINA_FALSE;
-   if (!context) return EINA_FALSE;
-
-   /* We do not want to change the current keymap related behavior in TV profile for now */
-   if (!_TV)
-     {
-        const char *keyname_space = "space";
-        if ((strncmp(ev->keyname, keyname_space, strlen(keyname_space)) == 0) && (ev->modifiers & ECORE_EVENT_MODIFIER_SHIFT))
-          {
-             int keymap_index;
-             keymap_index = g_keyboard_mode_engligh ? g_keymap_index : 0;
-             e_comp_wl_input_keymap_set(g_keymap_info[keymap_index].rules, g_keymap_info[keymap_index].models, g_keymap_info[keymap_index].layout, NULL, NULL, NULL, NULL);
-             wl_keyboard_send_keymap(context->kbd.resource, WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1,
-                                     e_comp_wl->xkb.fd, e_comp_wl->xkb.size);
-             g_keyboard_mode_engligh = !g_keyboard_mode_engligh;
-
-             return EINA_TRUE;
-          }
-     }
-   return EINA_FALSE;
-}
-
-static Eina_Bool
 _e_text_input_method_context_ecore_cb_key_down(void *data, int ev_type EINA_UNUSED, Ecore_Event_Key *ev)
 {
    E_Input_Method_Context *context = data;
 
-   if (!_e_text_input_method_context_filter_hotkeys(context, ev))
-     {
-        _e_text_input_method_context_key_send(context, ev->keycode, ev->timestamp,
-                                              WL_KEYBOARD_KEY_STATE_PRESSED);
-     }
+   _e_text_input_method_context_key_send(context, ev->keycode, ev->timestamp,
+                                         WL_KEYBOARD_KEY_STATE_PRESSED);
 
    return ECORE_CALLBACK_RENEW;
 }
@@ -2458,10 +2387,6 @@ e_modapi_init(E_Module *m)
    E_LIST_HANDLER_APPEND(handlers, E_EVENT_CLIENT_RESIZE, _e_text_input_method_context_cb_client_resize, NULL);
 
    vconf_notify_key_changed(VCONFKEY_ISF_HW_KEYBOARD_INPUT_DETECTED, _keyboard_mode_changed_cb, NULL);
-   vconf_notify_key_changed(VCONFKEY_LANGSET, _display_language_changed_cb, NULL);
-
-   /* Find the current display language when initializing */
-   _display_language_changed_cb(NULL, NULL);
 
    eeze_udev_watch_hander = eeze_udev_watch_add(EEZE_UDEV_TYPE_KEYBOARD,
                                                 EEZE_UDEV_EVENT_REMOVE,
@@ -2491,7 +2416,6 @@ e_modapi_shutdown(E_Module *m EINA_UNUSED)
      }
 
    vconf_ignore_key_changed(VCONFKEY_ISF_HW_KEYBOARD_INPUT_DETECTED, _keyboard_mode_changed_cb);
-   vconf_ignore_key_changed(VCONFKEY_LANGSET, _display_language_changed_cb);
 
    if (eeze_udev_watch_hander)
      {