diff options
author | Peng Wu <alexepico@gmail.com> | 2014-06-24 16:24:11 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2014-06-24 16:25:48 +0800 |
commit | 7958c8f1ab1f6753aac5e4172a66e114cffd2943 (patch) | |
tree | cb53534d2b92f4b072977ed5ebb7630ca14d0439 /src | |
parent | c4b269aecf872d42fd65331c025c64017f144964 (diff) | |
download | ibus-libzhuyin-7958c8f1ab1f6753aac5e4172a66e114cffd2943.tar.gz ibus-libzhuyin-7958c8f1ab1f6753aac5e4172a66e114cffd2943.tar.xz ibus-libzhuyin-7958c8f1ab1f6753aac5e4172a66e114cffd2943.zip |
enable fallback editor
Diffstat (limited to 'src')
-rw-r--r-- | src/ZYZZhuyinEngine.cc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/ZYZZhuyinEngine.cc b/src/ZYZZhuyinEngine.cc index 399b3b0..033e34e 100644 --- a/src/ZYZZhuyinEngine.cc +++ b/src/ZYZZhuyinEngine.cc @@ -25,6 +25,7 @@ #include "ZYConfig.h" #include "ZYZConfig.h" #include "ZYRawEditor.h" +#include "ZYFallbackEditor.h" #include "ZYZZhuyinEditor.h" #include "ZYZPinyinEditor.h" @@ -36,7 +37,9 @@ ZhuyinEngine::ZhuyinEngine (IBusEngine *engine) : Engine (engine), m_props (ZhuyinConfig::instance ()), m_prev_pressed_key (IBUS_VoidSymbol), - m_input_mode (MODE_INIT) + m_input_mode (MODE_INIT), + m_fallback_editor (new FallbackEditor + (m_props, ZhuyinConfig::instance ())) { gint i; @@ -113,7 +116,13 @@ ZhuyinEngine::processKeyEvent (guint keyval, guint keycode, guint modifiers) return TRUE; } - retval = m_editors[m_input_mode]->processKeyEvent (keyval, keycode, modifiers); + if (m_props.modeChinese ()) { + retval = m_editors[m_input_mode]->processKeyEvent + (keyval, keycode, modifiers); + } else { + retval = m_fallback_editor->processKeyEvent + (keyval, keycode, modifiers); + } /* store ignored key event by editors */ m_prev_pressed_key = retval ? IBUS_VoidSymbol : keyval; |