void InputMethodContextEfl::updateTextInputState() { if (!m_context) return; const EditorState& editor = m_view->page()->editorState(); if (editor.isContentEditable) { if (m_focused) return; ecore_imf_context_reset(m_context.get()); ecore_imf_context_focus_in(m_context.get()); m_focused = true; } else { if (!m_focused) return; if (editor.hasComposition) m_view->page()->cancelComposition(); m_focused = false; ecore_imf_context_reset(m_context.get()); ecore_imf_context_focus_out(m_context.get()); } }
/** * Unfocuses the entry object. It will no longer receives keyboard events so * the user could no longer type some text. The cursor and the selection will * be hidden * * @param entry the entry object to unfocus */ EAPI void e_entry_unfocus(Evas_Object *entry) { E_Entry_Smart_Data *sd; if (evas_object_smart_smart_get(entry) != _e_entry_smart) SMARTERRNR(); if ((!entry) || (!(sd = evas_object_smart_data_get(entry)))) return; if (!sd->focused) return; evas_object_focus_set(entry, 0); edje_object_signal_emit(sd->entry_object, "e,state,unfocused", "e"); e_editable_cursor_hide(sd->editable_object); e_editable_selection_hide(sd->editable_object); #ifdef HAVE_ECORE_IMF if (sd->imf_context) { ecore_imf_context_reset(sd->imf_context); ecore_imf_context_focus_out(sd->imf_context); } #endif sd->focused = 0; }
void InputMethodContextEfl::handleMouseUpEvent(const Evas_Event_Mouse_Up*) { ecore_imf_context_reset(m_context.get()); }