diff --git a/honoka/src/honoka_def.h b/honoka/src/honoka_def.h index 065c51a..7cff608 100644 --- a/honoka/src/honoka_def.h +++ b/honoka/src/honoka_def.h @@ -115,6 +115,9 @@ #define HONOKA_CONFIG_PREDICTION "/IMEngine/Honoka/Prediction" #define HONOKA_DEFAULT_PREDICTION true +#define HONOKA_CONFIG_REALTIME_PREDICTION "/IMEngine/Honoka/RealtimePrediction" +#define HONOKA_DEFAULT_REALTIME_PREDICTION true + #define HONOKA_PROP_MODESTATUS "/IMEngine/Honoka/Property/ModeStatus" #define HONOKA_PROP_INPUTMODE "/IMEngine/Honoka/InputMode" #define HONOKA_PROP_CONVERSIONMODE "/IMEngine/Honoka/ConversionMode" diff --git a/honoka/src/honoka_imengine.cpp b/honoka/src/honoka_imengine.cpp index 571fc7f..6c4385b 100644 --- a/honoka/src/honoka_imengine.cpp +++ b/honoka/src/honoka_imengine.cpp @@ -320,6 +320,7 @@ mini_status = _scim_config->read(String(HONOKA_CONFIG_MINISTATUS),HONOKA_DEFAULT_MINISTATUS); numkeyselect = _scim_config->read(String(HONOKA_CONFIG_NUMKEY_SELECT),HONOKA_DEFAULT_NUMKEY_SELECT); prediction = _scim_config->read(String(HONOKA_CONFIG_PREDICTION),HONOKA_DEFAULT_PREDICTION); + realtime_prediction = _scim_config->read(String(HONOKA_CONFIG_REALTIME_PREDICTION),HONOKA_DEFAULT_REALTIME_PREDICTION); if (m_predictor->getName() == "Predictor") prediction = false; defaultPreEditor = _scim_config->read(String(HONOKA_CONFIG_DEFAULT_PREEDITOR),String(HONOKA_DEFAULT_DEFAULT_PREEDITOR)); @@ -669,7 +670,7 @@ update_preedit_caret(m_preeditor->getPos()); } // Prediction - if ((!m_conversion) && prediction && m_predictor->isConnected() && (!auto_conversion)) { + if ((!m_conversion) && realtime_prediction && prediction && m_predictor->isConnected() && (!auto_conversion)) { m_convList = m_predictor->getPredictionList(m_preeditor->getText()); if (m_convList.count()) { m_lookup_table.clear(); @@ -861,6 +862,16 @@ return true; } else if (k_select_prediction.comp(key) && prediction) { + if (!realtime_prediction) { + m_convList = m_predictor->getPredictionList(m_preeditor->getText()); + if (m_convList.count()) { + m_lookup_table.clear(); + for(unsigned int i = 0;i < m_convList.count();i ++) { + m_lookup_table.append_candidate(m_convList.kouho.at(i).kanji); + } + startLookup(); + } + } if ((m_convList.kType == PREDICTION) && (m_convList.count())) { return process_prediction_key_event(key); } diff --git a/honoka/src/honoka_imengine.h b/honoka/src/honoka_imengine.h index 70d7246..de9aac5 100644 --- a/honoka/src/honoka_imengine.h +++ b/honoka/src/honoka_imengine.h @@ -130,6 +130,7 @@ bool numkeyselect; bool mini_status; bool prediction; + bool realtime_prediction; bool auto_conversion; String defaultPreEditor; String defaultConvertor;