Sending hide_ise_keys to the helper ISE if that keys pressed 73/34073/1
authorWonkeun Oh <wonkeun.oh@samsung.com>
Fri, 28 Nov 2014 09:54:05 +0000 (18:54 +0900)
committerLi Zhang <li2012.zhang@samsung.com>
Wed, 21 Jan 2015 03:44:57 +0000 (11:44 +0800)
Change-Id: I7d0b56d85a8188b96b46e255e5d7ca2f3c6a424f

ism/extras/efl_immodule/isf_imf_context.cpp
ism/src/scim_event.cpp
ism/src/scim_keyevent_data.h

index 9b7ad7f..15c81f5 100644 (file)
@@ -586,8 +586,10 @@ _key_up_cb (void *data, int type, void *event)
     SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
 
     unsigned int val = 0;
+    Eina_Bool ret = EINA_FALSE;
     Ecore_IMF_Context *active_ctx = get_using_ic (ECORE_IMF_INPUT_PANEL_STATE_EVENT, ECORE_IMF_INPUT_PANEL_STATE_SHOW);
 
+    EcoreIMFContextISF *ic = (EcoreIMFContextISF*) ecore_imf_context_data_get (active_ctx);
     Ecore_Event_Key *ev = (Ecore_Event_Key *)event;
     if (!ev || !ev->keyname || !active_ctx) return ECORE_CALLBACK_RENEW;
 
@@ -598,8 +600,19 @@ _key_up_cb (void *data, int type, void *event)
         if (ecore_imf_context_input_panel_state_get (active_ctx) != ECORE_IMF_INPUT_PANEL_STATE_HIDE) {
             if (filter_keys (ev->keyname, SCIM_CONFIG_HOTKEYS_FRONTEND_HIDE_ISE)) {
                 LOGD ("%s key is released.\n", ev->keyname);
-                isf_imf_context_reset (active_ctx);
-                isf_imf_context_input_panel_instant_hide (active_ctx);
+                if (_active_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
+                    KeyEvent key;
+                    scim_string_to_key (key, ev->key);
+                    LOGD ("process hide_ise_key_event to handle it in the helper: %s", ev->keyname);
+                    void *pvoid = &ret;
+                    _panel_client.prepare (ic->id);
+                    _panel_client.process_key_event (key, (int*) pvoid);
+                    _panel_client.send ();
+                }
+                if (!ret) {
+                    isf_imf_context_reset (active_ctx);
+                    isf_imf_context_input_panel_instant_hide (active_ctx);
+                }
                 return ECORE_CALLBACK_DONE;
             }
         }
index 20ff5a7..3eda874 100644 (file)
@@ -49,7 +49,7 @@ struct __KeyCodeMap
 
 struct __KeyName
 {
-    uint16      value;
+    uint32      value;
     const char *name;
 };
 
@@ -76,11 +76,11 @@ public:
         return lhs.value < rhs.value;
     }
 
-    bool operator ()(const __KeyName &lhs, const uint16 &rhs) const {
+    bool operator ()(const __KeyName &lhs, const uint32 &rhs) const {
         return lhs.value < rhs;
     }
 
-    bool operator ()(const uint16 &lhs, const __KeyName &rhs) const {
+    bool operator ()(const uint32 &lhs, const __KeyName &rhs) const {
         return lhs < rhs.value;
     }
 };
@@ -185,10 +185,10 @@ KeyEvent::get_key_string () const
 
     if (code == 0xFFFFFF) {
         codestr = String ("VoidSymbol");
-    } else if (code <= 0xFFFF){
+    } else if (code <= 0xFFFFFFFF){
         __KeyName *it = std::lower_bound (__scim_keys_by_code,
                                           __scim_keys_by_code + SCIM_NUM_KEY_NAMES,
-                                          (uint16) code,
+                                          code,
                                           __KeyNameLessByCode ());
 
         if (it != __scim_keys_by_code + SCIM_NUM_KEY_NAMES && it->value == code)
@@ -197,7 +197,7 @@ KeyEvent::get_key_string () const
 
     if (!codestr.length () && code) {
         char buf [20];
-        snprintf (buf, 20, ((code <= 0xFFFF) ? "0x%04x" : "0x%06x"), code);
+        snprintf (buf, 20, ((code <= 0xFFFF) ? "0x%04x" : "0x%08x"), code);
         codestr = String (buf);
     }
 
index 5bf95fa..af41642 100644 (file)
@@ -2520,7 +2520,8 @@ static __KeyName __scim_keys_by_code [] = {
   { 0xffec, "Super_R" },
   { 0xffed, "Hyper_L" },
   { 0xffee, "Hyper_R" },
-  { 0xffff, "Delete" }
+  { 0xffff, "Delete" },
+  { 0x1008ff26, "XF86Back" }
 };
 
 static __KeyName __scim_keys_by_name [] = {
@@ -3593,6 +3594,7 @@ static __KeyName __scim_keys_by_name [] = {
   { 0x12A8, "Wgrave" },
   { 0x20A9, "WonSign" },
   { 0x0058, "X" },
+  { 0x1008ff26, "XF86Back" },
   { 0x16A3, "Xabovedot" },
   { 0x0059, "Y" },
   { 0x00DD, "Yacute" },