summaryrefslogtreecommitdiffstats
path: root/src/PYPBopomofoEditor.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/PYPBopomofoEditor.cc')
-rw-r--r--src/PYPBopomofoEditor.cc16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/PYPBopomofoEditor.cc b/src/PYPBopomofoEditor.cc
index 4588a34..5b9fa26 100644
--- a/src/PYPBopomofoEditor.cc
+++ b/src/PYPBopomofoEditor.cc
@@ -166,7 +166,7 @@ BopomofoEditor::processSelectKey (guint keyval, guint keycode,
gboolean
BopomofoEditor::processBopomofo (guint keyval, guint keycode,
- guint modifiers)
+ guint modifiers)
{
if (G_UNLIKELY (cmshm_filter (modifiers) != 0))
return m_text ? TRUE : FALSE;
@@ -211,6 +211,20 @@ BopomofoEditor::processKeyEvent (guint keyval, guint keycode,
m_select_mode = TRUE;
return processSpace (keyval, keycode, modifiers);
+ case IBUS_Return:
+ case IBUS_KP_Enter:
+ /* no user input */
+ if (m_text.empty ())
+ return FALSE;
+
+ if (m_config.enterKey ())
+ commit ();
+ else
+ PhoneticEditor::commit (m_text.c_str ());
+
+ reset ();
+ return TRUE;
+
case IBUS_Up: case IBUS_KP_Up:
case IBUS_Down: case IBUS_KP_Down:
case IBUS_Page_Up: case IBUS_KP_Page_Up: