diff options
author | Peng Huang <shawn.p.huang@gmail.com> | 2012-05-24 08:39:25 -0400 |
---|---|---|
committer | Peng Huang <shawn.p.huang@gmail.com> | 2012-05-24 08:39:25 -0400 |
commit | 8c80936cb3c47cba13d899b466c9e8b8ec446d33 (patch) | |
tree | c4d7d31ef27cd0ca48a64b4c5c6f66309c74e369 | |
parent | 2ac12b8973c11b40e569bb952d1e21d03e5ce6ef (diff) | |
download | ibus-pinyin-8c80936cb3c47cba13d899b466c9e8b8ec446d33.tar.gz |
Remove i,v,u prefix when input English.
BUG=http://code.google.com/p/ibus/issues/detail?id=728
TEST=Manually
Review URL: https://codereview.appspot.com/6210070
-rw-r--r-- | src/PYEditor.cc | 11 | ||||
-rw-r--r-- | src/PYPinyinEngine.cc | 4 |
2 files changed, 9 insertions, 6 deletions
diff --git a/src/PYEditor.cc b/src/PYEditor.cc index 47c3a6e..4f5b950 100644 --- a/src/PYEditor.cc +++ b/src/PYEditor.cc @@ -93,8 +93,15 @@ Editor::processKeyEvent (guint keyval, guint keycode, guint modifiers) case IBUS_Return: case IBUS_KP_Enter: { - StaticText text (m_text); - commitText (text); + if (!m_text.empty () && + (m_text[0] == 'i' || m_text[0] == 'u' || m_text[0] == 'v')) { + StaticText text (m_text.substr(1)); + commitText(text); + } + else { + StaticText text (m_text); + commitText (text); + } reset (); } return TRUE; diff --git a/src/PYPinyinEngine.cc b/src/PYPinyinEngine.cc index c871b7c..b8c8130 100644 --- a/src/PYPinyinEngine.cc +++ b/src/PYPinyinEngine.cc @@ -123,22 +123,18 @@ PinyinEngine::processKeyEvent (guint keyval, guint keycode, guint modifiers) case IBUS_grave: m_input_mode = MODE_PUNCT; break; -#ifdef IBUS_BUILD_LUA_EXTENSION case IBUS_i: // do not enable lua extension when use double pinyin. if (PinyinConfig::instance ().doublePinyin ()) break; m_input_mode = MODE_EXTENSION; break; -#endif -#ifdef IBUS_BUILD_ENGLISH_INPUT_MODE case IBUS_v: // do not enable english mode when use double pinyin. if (PinyinConfig::instance ().doublePinyin ()) break; m_input_mode = MODE_ENGLISH; break; -#endif } } else { |