summaryrefslogtreecommitdiffstats
path: root/src/PYPPinyinEngine.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/PYPPinyinEngine.cc')
-rw-r--r--src/PYPPinyinEngine.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/PYPPinyinEngine.cc b/src/PYPPinyinEngine.cc
index c219f09..4e5be29 100644
--- a/src/PYPPinyinEngine.cc
+++ b/src/PYPPinyinEngine.cc
@@ -31,6 +31,9 @@
#ifdef IBUS_BUILD_ENGLISH_INPUT_MODE
#include "PYEnglishEditor.h"
#endif
+#ifdef IBUS_BUILD_STROKE_INPUT_MODE
+#include "PYStrokeEditor.h"
+#endif
#include "PYPFullPinyinEditor.h"
#include "PYPDoublePinyinEditor.h"
#include "PYFallbackEditor.h"
@@ -71,6 +74,11 @@ LibPinyinPinyinEngine::LibPinyinPinyinEngine (IBusEngine *engine)
#else
m_editors[MODE_ENGLISH].reset (new Editor (m_props, LibPinyinPinyinConfig::instance ()));
#endif
+#ifdef IBUS_BUILD_STROKE_INPUT_MODE
+ m_editors[MODE_STROKE].reset (new StrokeEditor (m_props, LibPinyinPinyinConfig::instance ()));
+#else
+ m_editors[MODE_STROKE].reset (new Editor (m_props, LibPinyinPinyinConfig::instance ()));
+#endif
m_props.signalUpdateProperty ().connect
(std::bind (&LibPinyinPinyinEngine::updateProperty, this, _1));
@@ -149,6 +157,14 @@ LibPinyinPinyinEngine::processKeyEvent (guint keyval, guint keycode, guint modif
m_input_mode = MODE_ENGLISH;
break;
#endif
+#ifdef IBUS_BUILD_STROKE_INPUT_MODE
+ case IBUS_u:
+ // do not enable stroke mode when use double pinyin.
+ if (LibPinyinPinyinConfig::instance ().doublePinyin ())
+ break;
+ m_input_mode = MODE_STROKE;
+ break;
+#endif
}
} else {
/* TODO: Unknown */