summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2018-06-27 11:44:25 +0800
committerPeng Wu <alexepico@gmail.com>2018-06-27 11:44:25 +0800
commit96307d95a49078c7bb645ae60c216cafb431f8a9 (patch)
tree5add047fe558e846fb601502048be7405e4d0aa1
parent76318b525e8dd4635ac628d184dc6186c9bee966 (diff)
downloadibus-libpinyin-96307d95a49078c7bb645ae60c216cafb431f8a9.tar.gz
ibus-libpinyin-96307d95a49078c7bb645ae60c216cafb431f8a9.tar.xz
ibus-libpinyin-96307d95a49078c7bb645ae60c216cafb431f8a9.zip
fixes processKeyEvent method
-rw-r--r--src/PYPBopomofoEngine.cc6
-rw-r--r--src/PYPPinyinEngine.cc6
2 files changed, 8 insertions, 4 deletions
diff --git a/src/PYPBopomofoEngine.cc b/src/PYPBopomofoEngine.cc
index d13bde6..e2154d1 100644
--- a/src/PYPBopomofoEngine.cc
+++ b/src/PYPBopomofoEngine.cc
@@ -160,10 +160,12 @@ BopomofoEngine::processKeyEvent (guint keyval, guint keycode, guint modifiers)
retval = m_editors[m_input_mode]->processKeyEvent (keyval, keycode, modifiers);
- if (retval)
+ if (retval) {
goto out;
- else
+ } else {
+ m_editors[m_input_mode]->reset ();
m_input_mode = MODE_INIT;
+ }
}
if (G_UNLIKELY (m_input_mode == MODE_INIT &&
diff --git a/src/PYPPinyinEngine.cc b/src/PYPPinyinEngine.cc
index 0d184de..938c547 100644
--- a/src/PYPPinyinEngine.cc
+++ b/src/PYPPinyinEngine.cc
@@ -235,10 +235,12 @@ PinyinEngine::processKeyEvent (guint keyval, guint keycode, guint modifiers)
retval = m_editors[m_input_mode]->processKeyEvent (keyval, keycode, modifiers);
- if (retval)
+ if (retval) {
goto out;
- else
+ } else {
+ m_editors[m_input_mode]->reset ();
m_input_mode = MODE_INIT;
+ }
}
/* handle normal input. */