, m_doNotHandleFakeKeyEvent(false)
, m_fakeKeyEventTimer(this, &InputMethodContextEfl::fakeKeyEventTimerFired)
, m_approximateCursorPosition(0)
+ , m_isLastKeyEventFiltered(false)
#endif
{
#if ENABLE(TIZEN_ISF_PORT)
if (!m_context)
return;
+ const EditorState& state = m_viewImpl->page()->editorState();
+
+ if (!m_isLastKeyEventFiltered && !m_approximateSurroundingText.isNull() && !state.hasComposition)
+ ecore_imf_context_cursor_position_set(m_context.get(), m_approximateCursorPosition);
+
if (m_fakeKeyEventTimer.isActive())
m_fakeKeyEventTimer.stop();
else
#if ENABLE(TIZEN_ISF_PORT)
m_doNotHandleFakeKeyEvent = false;
+ m_isLastKeyEventFiltered = *isFiltered;
- const EditorState& state = m_viewImpl->page()->editorState();
-
- if (m_approximateSurroundingText.isNull() && downEvent->compose) {
- if (downEvent->compose[0] == 0x8) {
+ if (!*isFiltered) {
+ if (!strcmp(downEvent->key, "BackSpace")) {
if (state.cursorPosition > 0)
updateApproximateText(String(), state.cursorPosition - 1, 1);
- } else if (downEvent->compose[0] == 0x7f) {
+ } else if (!strcmp(downEvent->key, "Delete")) {
if (state.cursorPosition < state.surroundingText.length())
updateApproximateText(String(), state.cursorPosition, 1);
} else
updateApproximateText(String::fromUTF8(downEvent->compose), 0, 0);
}
-
- if (!state.hasComposition)
- ecore_imf_context_cursor_position_set(m_context.get(), m_approximateCursorPosition);
#endif
}
else
hideIMFContext();
+ m_approximateSurroundingText = String();
+
if (m_context && !editor.hasComposition)
ecore_imf_context_cursor_position_set(m_context.get(), editor.cursorPosition);
-
- m_approximateSurroundingText = String();
}
void InputMethodContextEfl::updateTextInputStateByUserAction(bool setFocus)
memset(&downEvent, 0, sizeof(Evas_Event_Key_Down));
downEvent.key = data;
downEvent.string = data;
- m_viewImpl->page()->handleKeyboardEvent(NativeWebKeyboardEvent(&downEvent, true));
+ NativeWebKeyboardEvent nativeEvent(&downEvent, true);
+ nativeEvent.setInputMethodContextID(m_viewImpl->page()->editorState().inputMethodContextID);
+ m_viewImpl->page()->handleKeyboardEvent(nativeEvent);
Evas_Event_Key_Up upEvent;
memset(&upEvent, 0, sizeof(Evas_Event_Key_Up));