diff options
author | Peng Wu <alexepico@gmail.com> | 2018-02-23 15:21:49 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2018-02-23 15:21:49 +0800 |
commit | 28fa26af3d5680253e7a47953801add0e44118bf (patch) | |
tree | b26847d40f2da516489a970fb9b66184af707f5f /src/PYFallbackEditor.cc | |
parent | eb90e12e30741acff3dc5e66ce0763a1c363d4c3 (diff) | |
download | ibus-libpinyin-28fa26af3d5680253e7a47953801add0e44118bf.tar.gz ibus-libpinyin-28fa26af3d5680253e7a47953801add0e44118bf.tar.xz ibus-libpinyin-28fa26af3d5680253e7a47953801add0e44118bf.zip |
fixes LyX shortcut issue in class FallbackEditor
Diffstat (limited to 'src/PYFallbackEditor.cc')
-rw-r--r-- | src/PYFallbackEditor.cc | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/PYFallbackEditor.cc b/src/PYFallbackEditor.cc index fdd6cee..6ac5449 100644 --- a/src/PYFallbackEditor.cc +++ b/src/PYFallbackEditor.cc @@ -79,7 +79,7 @@ FallbackEditor::processPunctForSimplifiedChinese (guint keyval, guint keycode, g commit (","); return TRUE; case '.': if (m_prev_committed_char >= '0' && m_prev_committed_char <= '9') - commit (keyval); + return FALSE; else commit ("。"); return TRUE; @@ -147,7 +147,7 @@ FallbackEditor::processPunctForTraditionalChinese (guint keyval, guint keycode, commit (","); return TRUE; case '.': if (m_prev_committed_char >= '0' && m_prev_committed_char <= '9') - commit (keyval); + return FALSE; else commit ("。"); return TRUE; @@ -175,7 +175,7 @@ FallbackEditor::processPunct (guint keyval, guint keycode, guint modifiers) if (G_UNLIKELY (m_props.modeFull ())) commit (HalfFullConverter::toFull (keyval)); else - commit (keyval); + return FALSE; return TRUE; } else { @@ -190,7 +190,10 @@ FallbackEditor::processPunct (guint keyval, guint keycode, guint modifiers) return TRUE; } } - commit (m_props.modeFull () ? HalfFullConverter::toFull (keyval) : keyval); + if (m_props.modeFull ()) + commit (HalfFullConverter::toFull (keyval)); + else + return FALSE; } return TRUE; } @@ -215,7 +218,10 @@ FallbackEditor::processKeyEvent (guint keyval, guint keycode, guint modifiers) case IBUS_a ... IBUS_z: case IBUS_A ... IBUS_Z: if (modifiers == 0) { - commit (m_props.modeFull () ? HalfFullConverter::toFull (keyval) : keyval); + if (!m_props.modeFull ()) + return FALSE; + + commit (HalfFullConverter::toFull (keyval)); retval = TRUE; } break; @@ -254,7 +260,10 @@ FallbackEditor::processKeyEvent (guint keyval, guint keycode, guint modifiers) keyval = IBUS_space; case IBUS_space: if (modifiers == 0) { - commit (m_props.modeFull () ? " " : " "); + if (!m_props.modeFull ()) + return FALSE; + + commit (" "); retval = TRUE; } break; |