diff options
Diffstat (limited to 'src/PYPPinyinEngine.cc')
-rw-r--r-- | src/PYPPinyinEngine.cc | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/PYPPinyinEngine.cc b/src/PYPPinyinEngine.cc index efb518e..8c241d5 100644 --- a/src/PYPPinyinEngine.cc +++ b/src/PYPPinyinEngine.cc @@ -197,14 +197,28 @@ PinyinEngine::processAccelKeyEvent (guint keyval, guint keycode, } /* Toggle full/half Letter Mode */ - if (PinyinConfig::instance (). letterSwitch () == accel) { + if (PinyinConfig::instance ().letterSwitch () == accel) { m_props.toggleModeFull (); m_prev_pressed_key = keyval; return TRUE; } /* Toggle full/half Punct Mode */ - if (PinyinConfig::instance (). punctSwitch () == accel) { + if (PinyinConfig::instance ().punctSwitch () == accel) { + m_props.toggleModeFullPunct (); + m_prev_pressed_key = keyval; + return TRUE; + } + + /* Toggle both full/half Mode */ + if (PinyinConfig::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; |