diff options
author | Peng Wu <alexepico@gmail.com> | 2014-07-16 11:13:19 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2014-07-16 11:19:42 +0800 |
commit | 845b2be28e93b9abecfabeaaecc7212a61ed0b93 (patch) | |
tree | e4f142b1c3656106ac10cba8b30f49dae2f0da87 | |
parent | 2df15cf58d5a9e4da1838819d04aa095bb7eaaa3 (diff) | |
download | ibus-libzhuyin-845b2be28e93b9abecfabeaaecc7212a61ed0b93.tar.gz ibus-libzhuyin-845b2be28e93b9abecfabeaaecc7212a61ed0b93.tar.xz ibus-libzhuyin-845b2be28e93b9abecfabeaaecc7212a61ed0b93.zip |
fixes method processKeyEvent
-rw-r--r-- | src/ZYFallbackEditor.cc | 9 | ||||
-rw-r--r-- | src/ZYZPhoneticEditor.cc | 7 | ||||
-rw-r--r-- | src/ZYZZhuyinEngine.cc | 12 |
3 files changed, 11 insertions, 17 deletions
diff --git a/src/ZYFallbackEditor.cc b/src/ZYFallbackEditor.cc index 806f3b5..15587d3 100644 --- a/src/ZYFallbackEditor.cc +++ b/src/ZYFallbackEditor.cc @@ -154,15 +154,6 @@ FallbackEditor::processKeyEvent (guint keyval, guint keycode, guint modifiers) case IBUS_space: retval = processEnglish (keyval, keycode, modifiers); break; - /* enter */ - case IBUS_Return: - case IBUS_KP_Enter: - { - Text text ("\n"); - commitText (text); - retval = TRUE; - } - break; /* others */ default: break; diff --git a/src/ZYZPhoneticEditor.cc b/src/ZYZPhoneticEditor.cc index 7a09c69..02bc818 100644 --- a/src/ZYZPhoneticEditor.cc +++ b/src/ZYZPhoneticEditor.cc @@ -99,11 +99,8 @@ PhoneticEditor::processEnter (guint keyval, guint keycode, if (cmshm_filter (modifiers) != 0) return TRUE; - if (!m_text) { - Text text ("\n"); - commitText (text); - return TRUE; - } + if (!m_text) + return FALSE; commit (); return TRUE; diff --git a/src/ZYZZhuyinEngine.cc b/src/ZYZZhuyinEngine.cc index 46bae9b..3ea3405 100644 --- a/src/ZYZZhuyinEngine.cc +++ b/src/ZYZZhuyinEngine.cc @@ -113,9 +113,15 @@ ZhuyinEngine::processKeyEvent (guint keyval, guint keycode, guint modifiers) return TRUE; } - } else { - /* skip the key press event. */ - return TRUE; + + if (m_input_mode == MODE_INIT && + m_editors[MODE_INIT]->text ().empty ()) { + /* If it is init mode, and no any previous input text, + * we will let client applications to handle release key event */ + return FALSE; + } else { + return TRUE; + } } if (m_props.modeChinese ()) { |