diff --git a/honoka/src/honoka_imengine.cpp b/honoka/src/honoka_imengine.cpp index 2d587c6..8f95e84 100644 --- a/honoka/src/honoka_imengine.cpp +++ b/honoka/src/honoka_imengine.cpp @@ -377,7 +377,7 @@ */ void HonokaInstance::changeConvertor(const String &name) { - if (m_conversion) return; + //if (m_conversion) return; for(unsigned int i = 0;i < convertors.size();i ++) { if (convertors[i]->getPropertyName() == name) { m_convertor = convertors[i]; @@ -766,6 +766,25 @@ } return(true); } else + if (k_next_convertor.comp(key) || k_prev_convertor.comp(key)) { + for(unsigned int i = 0;i < convertors.size();i ++) { + if (convertors[i]->getPropertyName() == m_convertor->getPropertyName()) { + if (k_next_convertor.comp(key)) { + if (i == (convertors.size() - 1)) i = 0; + else i ++; + } else { + if (i == 0) i = convertors.size() - 1; + else i --; + } + changeConvertor(convertors[i]->getPropertyName()); + if (m_def_convertor != m_convertor) { + m_def_convertor->reset(); + startConversion(); + } + return(true); + } + } + } else if (key.get_ascii_code()) { if (key.mask & (SCIM_KEY_AltMask | SCIM_KEY_ControlMask)) return(false); if (m_lookup && numkeyselect) { @@ -1005,6 +1024,9 @@ void HonokaInstance::startConversion(WideString s) { // ����lookup�Ͼä��Ƥ������� + m_def_convertor = m_convertor; + if (!s.length()) s = yomi; + else yomi = s; m_lookup = false; m_lookup_table.clear(); hide_lookup_table(); diff --git a/honoka/src/honoka_imengine.h b/honoka/src/honoka_imengine.h index aee97d3..4370d9f 100644 --- a/honoka/src/honoka_imengine.h +++ b/honoka/src/honoka_imengine.h @@ -91,6 +91,7 @@ CommonLookupTable m_lookup_table; PreEditor *m_preeditor; Convertor *m_convertor; + Convertor *m_def_convertor; bool m_conversion; bool m_yosoku; bool m_lookup; @@ -107,11 +108,12 @@ vector preeditors; vector convertors; String sType; + WideString yomi; protected: bool process_preedit_key_event(const KeyEvent &key); bool process_conversion_key_event(const KeyEvent &key); bool process_yosoku_key_event(const KeyEvent &key); - void startConversion(WideString s); + void startConversion(WideString s = WideString()); void createLookupTable(ResultList cList); void init(); void updatePreEditor();