Ignore key event with only specific modifiers
authorChoe Hwanjin <choe.hwanjin@gmail.com>
Sun, 28 Aug 2011 08:40:35 +0000 (17:40 +0900)
committerChoe Hwanjin <choe.hwanjin@gmail.com>
Sun, 28 Aug 2011 08:59:40 +0000 (17:59 +0900)
Without this fix, a user cannot input korean when the user pressed
some keys and mouse buttons at the same time.

Before this, ibus-hangul ignored every key with every modifiers
except shift, capslock and numlock. But it is better to specify the
modifiers to ignore.

Issue #1289 IBus-hangul engine ignores key events when any mouse button is down

src/engine.c

index 7054bc6..84c55f4 100644 (file)
@@ -746,13 +746,13 @@ ibus_hangul_engine_process_key_event (IBusEngine     *engine,
         }
     }
 
-    // if we've got a key event with modifiers, commit current
+    // If we've got a key event with some modifiers, commit current
     // preedit string and ignore this key event.
     // So, if you want to add some key event handler, put it 
     // before this code.
-    // Omit shift, capslock, numlock and xkb modifiers.
-    mask = IBUS_MODIFIER_MASK &
-          ~(IBUS_SHIFT_MASK | IBUS_LOCK_MASK | IBUS_MOD2_MASK);
+    // Ignore key event with control, alt, super or mod5
+    mask = IBUS_CONTROL_MASK |
+           IBUS_MOD1_MASK | IBUS_MOD3_MASK | IBUS_MOD4_MASK | IBUS_MOD5_MASK;
     if (modifiers & mask) {
         ibus_hangul_engine_flush (hangul);
         return FALSE;