summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/PYEditor.cc11
-rw-r--r--src/PYPinyinEngine.cc4
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 {