summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/engine.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/src/engine.c b/src/engine.c
index 5f291fc..001aa89 100644
--- a/src/engine.c
+++ b/src/engine.c
@@ -1063,6 +1063,21 @@ ibus_hangul_engine_process_key_event (IBusEngine *engine,
if (hangul->input_purpose == IBUS_INPUT_PURPOSE_PASSWORD)
return IBUS_ENGINE_CLASS (parent_class)->process_key_event (engine, keyval, keycode, modifiers);
+ /* Process candidate key event before hot keys,
+ * or lookup table can't receive important events.
+ * For example, if Esc key is pressed, this key event should be used for
+ * closing lookup table, not for turning to latin mode. */
+ if (hangul->hanja_list != NULL) {
+ retval = ibus_hangul_engine_process_candidate_key_event (hangul,
+ keyval, modifiers);
+ if (hangul->hanja_mode) {
+ if (retval)
+ return TRUE;
+ } else {
+ return TRUE;
+ }
+ }
+
// If a hotkey has any modifiers, we ignore that modifier
// keyval, or we cannot make the hanja key work.
// Because when we get the modifier key alone, we commit the
@@ -1106,17 +1121,6 @@ ibus_hangul_engine_process_key_event (IBusEngine *engine,
return TRUE;
}
- if (hangul->hanja_list != NULL) {
- retval = ibus_hangul_engine_process_candidate_key_event (hangul,
- keyval, modifiers);
- if (hangul->hanja_mode) {
- if (retval)
- return TRUE;
- } else {
- return TRUE;
- }
- }
-
// 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