diff options
author | Peng Wu <alexepico@gmail.com> | 2014-12-18 13:39:44 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2014-12-18 13:39:44 +0800 |
commit | 84d1ce1d9ed8dd92c0434234a2964098133a7f88 (patch) | |
tree | 1a534f96b4164951de53b662798f212627529974 | |
parent | de6b1f956fec426ba45f3ec371e5ce802070fd67 (diff) | |
download | ibus-libpinyin-84d1ce1d9ed8dd92c0434234a2964098133a7f88.tar.gz ibus-libpinyin-84d1ce1d9ed8dd92c0434234a2964098133a7f88.tar.xz ibus-libpinyin-84d1ce1d9ed8dd92c0434234a2964098133a7f88.zip |
fixes processAccelKeyEvent method
-rw-r--r-- | src/PYPBopomofoEngine.cc | 4 | ||||
-rw-r--r-- | src/PYPPinyinEngine.cc | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/PYPBopomofoEngine.cc b/src/PYPBopomofoEngine.cc index 6c5caf2..6b62d11 100644 --- a/src/PYPBopomofoEngine.cc +++ b/src/PYPBopomofoEngine.cc @@ -136,6 +136,10 @@ BopomofoEngine::processKeyEvent (guint keyval, guint keycode, guint modifiers) if (processAccelKeyEvent (keyval, keycode, modifiers)) return TRUE; + /* assume release key event is handled in processAccelKeyEvent. */ + if (modifiers & IBUS_RELEASE_MASK) + return FALSE; + if (m_props.modeChinese ()) { if (G_UNLIKELY (m_input_mode == MODE_INIT && m_editors[MODE_INIT]->text ().empty () && diff --git a/src/PYPPinyinEngine.cc b/src/PYPPinyinEngine.cc index 6bb4285..344a50e 100644 --- a/src/PYPPinyinEngine.cc +++ b/src/PYPPinyinEngine.cc @@ -172,6 +172,10 @@ PinyinEngine::processKeyEvent (guint keyval, guint keycode, guint modifiers) if (processAccelKeyEvent (keyval, keycode, modifiers)) return TRUE; + /* assume release key event is handled in processAccelKeyEvent. */ + if (modifiers & IBUS_RELEASE_MASK) + return FALSE; + if (m_props.modeChinese ()) { if (m_input_mode == MODE_INIT && (cmshm_filter (modifiers) == 0)) { |