diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/PYBopomofoEngine.cc | 12 | ||||
| -rw-r--r-- | src/PYPinyinEngine.cc | 12 |
2 files changed, 22 insertions, 2 deletions
diff --git a/src/PYBopomofoEngine.cc b/src/PYBopomofoEngine.cc index a46f229..5945eb6 100644 --- a/src/PYBopomofoEngine.cc +++ b/src/PYBopomofoEngine.cc @@ -82,9 +82,19 @@ BopomofoEngine::processKeyEvent (guint keyval, guint keycode, guint modifiers) if (!m_editors[MODE_INIT]->text ().empty ()) m_editors[MODE_INIT]->reset (); m_props.toggleModeChinese (); + return TRUE; } } - return TRUE; + + if (m_input_mode == MODE_INIT && + m_editors[MODE_INIT]->text ().empty ()) { + /* If it is init mode, and no any previouse input text, + * we will let client applications to handle release key event */ + return FALSE; + } + else { + return TRUE; + } } /* Toggle simp/trad Chinese Mode when hotkey Ctrl + Shift + F pressed */ diff --git a/src/PYPinyinEngine.cc b/src/PYPinyinEngine.cc index 9f7c167..f773675 100644 --- a/src/PYPinyinEngine.cc +++ b/src/PYPinyinEngine.cc @@ -84,9 +84,19 @@ PinyinEngine::processKeyEvent (guint keyval, guint keycode, guint modifiers) if (!m_editors[MODE_INIT]->text ().empty ()) m_editors[MODE_INIT]->reset (); m_props.toggleModeChinese (); + return TRUE; } } - return TRUE; + + if (m_input_mode == MODE_INIT && + m_editors[MODE_INIT]->text ().empty ()) { + /* If it is init mode, and no any previouse input text, + * we will let client applications to handle release key event */ + return FALSE; + } + else { + return TRUE; + } } /* Toggle simp/trad Chinese Mode when hotkey Ctrl + Shift + F pressed */ |
