Send all key events to IMMODULE first and then process when requested 88/115288/1
authorJi-hoon Lee <dalton.lee@samsung.com>
Fri, 17 Feb 2017 08:05:12 +0000 (17:05 +0900)
committerJi-hoon Lee <dalton.lee@samsung.com>
Fri, 17 Feb 2017 08:08:43 +0000 (17:08 +0900)
The previous implementation had whitelist of key events that could be
sent to IMMODULE, and other key events were sent to IMEngine directly.
Modified scim_helper to send all key events to IMMODULE, and added
code for processing events starting with u/U.

Change-Id: Id5df610cfaade917a3cefc20c933da71da0e97b7

ism/src/scim_event.cpp
ism/src/scim_helper.cpp

index 31d4bba6cb886c6495c08e1e650f06d7cc521b43..ace9a458f4ed168bfd674044050c6a60987b9ac3 100644 (file)
@@ -300,6 +300,9 @@ scim_string_to_key (KeyEvent &key, const String & str)
             key.code = p->value;
         } else if (it->length () >= 6 && (*it)[0] == '0' && ((*it)[1] == 'x' || (*it)[1] == 'X')){
             key.code = strtol (it->c_str () + 2, NULL, 16);
+        } else if (it->length () >= 5 && ((*it)[0] == 'u' || (*it)[0] == 'U')){
+            key.code = strtol (it->c_str () + 1, NULL, 16);
+            key.code |= 0x1000000;
         } else if (p && p->name && strcmp (p->name, "VoidSymbol") == 0) {
             key.code = SCIM_KEY_VoidSymbol;
         }
index 00771949f253b533521135c1ec8390489acfb1e2..bb3ca9dc77bdb252e66d50d4324be98dc4eb68f2 100644 (file)
@@ -1525,27 +1525,7 @@ HelperAgent::send_key_event (int            ic,
         return;
     }
 
-    bool ret = false;
-
-#if ENABLE_GRAB_KEYBOARD
-    if (!m_impl->si.null ()) {
-#else
-    if (key.code <= 0x7F ||
-        (key.code >= SCIM_KEY_BackSpace && key.code <= SCIM_KEY_Delete) ||
-        (key.code >= SCIM_KEY_Home && key.code <= SCIM_KEY_Hyper_R)) {
-        // ascii code and function keys
-        ret = false;
-    } else {
-        ret = true;
-    }
-
-    if (ret && (!m_impl->si.null ())) {
-#endif
-        ret = m_impl->si->process_key_event (key);
-        LOGD ("imengine(%s) process key %d return %d", m_impl->si->get_factory_uuid().c_str(), key.code, ret);
-    }
-
-    if (ret == false && m_impl->socket_active.is_connected ()) {
+    if (m_impl->socket_active.is_connected ()) {
         m_impl->send.clear ();
         m_impl->send.put_command (SCIM_TRANS_CMD_REQUEST);
         m_impl->send.put_data (m_impl->magic_active);