Use xkb_keysym to look for unresolved keynames 79/116779/4
authorJi-hoon Lee <dalton.lee@samsung.com>
Tue, 28 Feb 2017 07:56:04 +0000 (16:56 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Tue, 28 Feb 2017 08:32:19 +0000 (00:32 -0800)
Change-Id: I41f3db37b61e04dd68b8a6dd58f4426f6b61eaa4

ism/modules/panelagent/wayland/wayland_panel_agent_module.cpp
ism/src/scim_event.cpp

index cb42b9c..36a1d14 100644 (file)
@@ -1597,7 +1597,13 @@ isf_wsc_context_filter_key_event (WSCContextISF* wsc_ctx,
     String _key(keysym);
     KeyEvent key;
 
-    scim_string_to_key (key, _key);
+    if (!scim_string_to_key (key, _key)) {
+        xkb_keysym_t code = xkb_keysym_from_name(keysym, XKB_KEYSYM_NO_FLAGS);
+        if (code == XKB_KEY_NoSymbol) {
+            code = xkb_keysym_from_name(keysym, XKB_KEYSYM_CASE_INSENSITIVE);
+        }
+        key.code = code;
+    }
     scim_set_device_info (key, dev_name ? dev_name : "", dev_class, dev_subclass);
 
     bool ignore_key = filter_keys (keysym, SCIM_CONFIG_HOTKEYS_FRONTEND_IGNORE_KEY);
index ace9a45..d52db4b 100644 (file)
@@ -270,6 +270,7 @@ scim_key_to_string (String &str, const KeyEvent & key)
 EXAPI bool
 scim_string_to_key (KeyEvent &key, const String & str)
 {
+    bool void_symbol = false;
     std::vector <String> list;
     bool skip;
     size_t i;
@@ -300,15 +301,13 @@ 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;
+            void_symbol = true;
         }
     }
 
-    return key.code != 0;
+    return void_symbol || key.code != 0;
 }
 
 EXAPI bool