diff --git a/scim-wnn/src/romkan.cpp b/scim-wnn/src/romkan.cpp index cb52511..1f120c9 100644 --- a/scim-wnn/src/romkan.cpp +++ b/scim-wnn/src/romkan.cpp @@ -186,6 +186,7 @@ { clear(); pos = 0; + mode = ROMA; } diff --git a/scim-wnn/src/scim_wnn_imengine.cpp b/scim-wnn/src/scim_wnn_imengine.cpp index 720bff7..da97de9 100644 --- a/scim-wnn/src/scim_wnn_imengine.cpp +++ b/scim-wnn/src/scim_wnn_imengine.cpp @@ -196,8 +196,9 @@ { m_conversion = false; m_lookup = false; + mini_status = true; // @todo should read from a config. - // @todo jserver�Ȥ���³��������ڤ�褦�ˤ��٤��� + // @todo if connected to jserver, should disconnect this. host = _scim_config->read(String(SCIM_CONFIG_WNN_SERVER),String(SCIM_DEFAULT_WNN_SERVER)); rc = _scim_config->read(String(SCIM_CONFIG_WNN_RC),String(SCIM_DEFAULT_WNN_RC)); @@ -273,6 +274,10 @@ update_preedit_string(m_preeditor->getText()); update_preedit_caret(m_preeditor->getPos()); } else hide_preedit_string(); + if (mini_status) { + update_aux_string(utf8_mbstowcs(m_preeditor->getModeName())); + show_aux_string(); + } } @@ -290,10 +295,13 @@ */ bool WnnInstance::process_preedit_key_event(const KeyEvent &key) { + // PreEditor�Υ������٥�ȥեå��� if (m_preeditor->keyEventHook(key)) { updatePreEditor(); return(true); } else + + // �Хåե������Ǥ�̵����硣 if (m_preeditor->getTextLength()) { if (k_conversion_start.comp(key)) { startConversion(m_preeditor->getText(true)); @@ -303,7 +311,7 @@ if (k_commit.comp(key)) { commit_string(m_preeditor->getText(true)); m_preeditor->reset(); - hide_preedit_string(); + updatePreEditor(); return(true); } else if (k_forward.comp(key) || k_backward.comp(key)) { @@ -316,15 +324,6 @@ updatePreEditor(); return(true); } else - if (k_cancel.comp(key)) { - if (m_preeditor->cancelEvent()) { - updatePreEditor(); - return(true); - } - m_preeditor->reset(); - hide_preedit_string(); - return(true); - } else if (k_convert_hiragana.comp(key)) { m_preeditor->kataHira(); updatePreEditor(); @@ -336,6 +335,19 @@ return(true); } } + + // �Хåե���¸�ߤˤ�����餺�� + if (k_cancel.comp(key)) { + if (m_preeditor->cancelEvent()) { + updatePreEditor(); + return(true); + } + if (m_preeditor->getTextLength()) { + m_preeditor->reset(); + } + updatePreEditor(); + return(true); + } if (isprint(key.code)) { if (key.mask & (SCIM_KEY_AltMask | SCIM_KEY_ControlMask)) return(false); // �Хåե������λ��ι�Ƭ���ڡ�����ľ�����ϡ� @@ -389,12 +401,11 @@ if (k_cancel.comp(key) || k_backspace.comp(key)) { wnn.reset(); m_conversion = false; - update_preedit_string(m_preeditor->getText()); - update_preedit_caret(m_preeditor->getPos()); hide_lookup_table(); hide_aux_string(); m_lookup = false; alp_count = 0; + updatePreEditor(); return(true); } else if (k_conversion_next.comp(key) || k_conversion_prev.comp(key)) { @@ -576,6 +587,7 @@ void WnnInstance::focus_in () { + if (!m_conversion) updatePreEditor(); } void WnnInstance::focus_out () @@ -612,6 +624,7 @@ */ void WnnInstance::startConversion(WideString s) { + hide_aux_string(); if (!m_connected) { m_connected = wnn.wnnConnect(String("scim-wnn"),host,rc,0); } diff --git a/scim-wnn/src/scim_wnn_imengine.h b/scim-wnn/src/scim_wnn_imengine.h index 1f8ff89..0f4d91b 100644 --- a/scim-wnn/src/scim_wnn_imengine.h +++ b/scim-wnn/src/scim_wnn_imengine.h @@ -89,6 +89,7 @@ PropertyList m_proplist; int alp; int alp_count; + bool mini_status; String host; String rc; bool m_connected;