summaryrefslogtreecommitdiffstats
path: root/src/PYPBopomofoEngine.cc
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2019-05-09 14:27:55 +0800
committerPeng Wu <alexepico@gmail.com>2019-05-09 14:27:55 +0800
commitd28daf1b85a0e52b2bfb7c82e901dce60df34cde (patch)
tree4ec9043a627d10df37a3aa6f0c7b73c06facbf42 /src/PYPBopomofoEngine.cc
parent27103d833d0aa6e572bd769695447ff4162269a5 (diff)
downloadibus-libpinyin-d28daf1b85a0e52b2bfb7c82e901dce60df34cde.tar.gz
ibus-libpinyin-d28daf1b85a0e52b2bfb7c82e901dce60df34cde.tar.xz
ibus-libpinyin-d28daf1b85a0e52b2bfb7c82e901dce60df34cde.zip
add both-switch option
Diffstat (limited to 'src/PYPBopomofoEngine.cc')
-rw-r--r--src/PYPBopomofoEngine.cc18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/PYPBopomofoEngine.cc b/src/PYPBopomofoEngine.cc
index 3621f1b..9838130 100644
--- a/src/PYPBopomofoEngine.cc
+++ b/src/PYPBopomofoEngine.cc
@@ -112,14 +112,28 @@ BopomofoEngine::processAccelKeyEvent (guint keyval, guint keycode,
}
/* Toggle full/half Letter Mode */
- if (BopomofoConfig::instance (). letterSwitch () == accel) {
+ if (BopomofoConfig::instance ().letterSwitch () == accel) {
m_props.toggleModeFull ();
m_prev_pressed_key = keyval;
return TRUE;
}
/* Toggle full/half Punct Mode */
- if (BopomofoConfig::instance (). punctSwitch () == accel) {
+ if (BopomofoConfig::instance ().punctSwitch () == accel) {
+ m_props.toggleModeFullPunct ();
+ m_prev_pressed_key = keyval;
+ return TRUE;
+ }
+
+ /* Toggle both full/half Mode */
+ if (BopomofoConfig::instance ().bothSwitch () == accel) {
+ if (m_props.modeFull () != m_props.modeFullPunct ()) {
+ m_props.toggleModeFull ();
+ m_prev_pressed_key = keyval;
+ return TRUE;
+ }
+
+ m_props.toggleModeFull ();
m_props.toggleModeFullPunct ();
m_prev_pressed_key = keyval;
return TRUE;