Check whether hic is transliteration method or not
authorChoe Hwanjin <choe.hwanjin@gmail.com>
Mon, 17 Oct 2011 02:28:45 +0000 (11:28 +0900)
committerChoe Hwanjin <choe.hwanjin@gmail.com>
Mon, 17 Oct 2011 02:28:45 +0000 (11:28 +0900)
Normalizing keyval is applied only when the hic is in transliteration
mode. The information about the input method logic should be retrieved
from libhangul hic.
So we use new API from libhangul 0.1.0.

configure.ac
src/engine.c

index 54738dd..8c80b59 100644 (file)
@@ -57,7 +57,7 @@ PKG_CHECK_MODULES(IBUS, [
 
 # check libhangul
 PKG_CHECK_MODULES(HANGUL, [
-    libhangul >= 0.0.12
+    libhangul >= 0.1.0
 ])
 
 # check env
index 84c55f4..101c4ef 100644 (file)
@@ -766,7 +766,11 @@ ibus_hangul_engine_process_key_event (IBusEngine     *engine,
        // each key, not the character. We make the keyval from keycode
        // as if the keyboard is US qwerty layout. Then we can assume the
        // keyval represent the position of the each key.
-       if (strcmp(hangul_keyboard->str, "ro") != 0) {
+       // But if the hic is in transliteration mode, then we should not
+       // normalize the keyval.
+       bool is_transliteration_mode =
+                hangul_ic_is_transliteration(hangul->context);
+       if (!is_transliteration_mode) {
            if (keymap != NULL)
                keyval = ibus_keymap_lookup_keysym(keymap, keycode, modifiers);
        }