diff options
author | Peng Wu <alexepico@gmail.com> | 2018-02-23 15:54:25 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2018-02-23 15:54:25 +0800 |
commit | f80b1fbf06ffe89a15ad74d7c0c4e8b4aa4ec1c2 (patch) | |
tree | 8600e06548db336d70f3d7bfe12538f9d12cac8b /src/PYStrokeEditor.cc | |
parent | 28fa26af3d5680253e7a47953801add0e44118bf (diff) | |
download | ibus-libpinyin-f80b1fbf06ffe89a15ad74d7c0c4e8b4aa4ec1c2.tar.gz ibus-libpinyin-f80b1fbf06ffe89a15ad74d7c0c4e8b4aa4ec1c2.tar.xz ibus-libpinyin-f80b1fbf06ffe89a15ad74d7c0c4e8b4aa4ec1c2.zip |
enable English and Stroke Editor for Double Pinyin
Diffstat (limited to 'src/PYStrokeEditor.cc')
-rw-r--r-- | src/PYStrokeEditor.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/PYStrokeEditor.cc b/src/PYStrokeEditor.cc index 20bc84f..af26baa 100644 --- a/src/PYStrokeEditor.cc +++ b/src/PYStrokeEditor.cc @@ -194,11 +194,11 @@ StrokeEditor::processKeyEvent (guint keyval, guint keycode, guint modifiers) /* Remember the input string. */ if (m_cursor == 0) { - g_return_val_if_fail ('u' == keyval, FALSE); - m_text = "u"; + g_return_val_if_fail ('u' == keyval || 'U' == keyval, FALSE); + m_text.insert (m_cursor, keyval); m_cursor ++; } else { - g_return_val_if_fail ('u' == m_text[0], FALSE); + g_return_val_if_fail ('u' == m_text[0] || 'U' == m_text[0], FALSE); if (keyval >= 'a' && keyval <= 'z') { /* only lower case characters here */ m_text.insert (m_cursor, keyval); @@ -371,14 +371,15 @@ StrokeEditor::updateStateFromInput (void) return FALSE; } - if ('u' != m_text[0]) { + if ('u' != m_text[0] && 'U' != m_text[0]) { g_warning ("u is expected in m_text string.\n"); m_auxiliary_text = ""; clearLookupTable (); return FALSE; } - m_auxiliary_text = "u"; + m_auxiliary_text.printf("%c", m_text[0]); + if (1 == m_text.length ()) { clearLookupTable (); |