0

I'm having an entry:

auto myEntry = elm_entry_add(..);

Its focused event works great for detecting when it's getting actually edited:

evas_object_smart_callback_add(myEntry, "focused", onOpen, NULL);

This calls my onOpen function when the entry is focused, thus when it's getting edited:

enter image description here

When I edit the text, I can use another event: changed, to detect when user finishes (or more appropriate: changed,user).

However, when user just dismiss it without changing (by pressing the back key), I don't get any events:

  • aborted: not called
  • changed: not called, as text has not been changed
  • unfocused: not called, as the entry hasn't lost its focus, just it's editor has been closed.

Other events are mainly for selection and cursor.

How can I detect when editor has been closed?

Daniel
  • 2,318
  • 2
  • 22
  • 53

2 Answers2

1

I think your approach is best.

Note that there is also a way to use conformant's API. https://docs.tizen.org/application/native/guides/ui/efl/container-conformant/

evas_object_smart_callback_add(ad->conform, "virtualkeypad,size,changed", keypad_size_changed, NULL);
static void keypad_size_changed(void *data, Evas_Object *obj, void *event_info)
{
    Eina_Rectangle *rect = event_info;
    printf("keypad_size_changed [%d %d %d %d] \n", rect->x, rect->y, rect->w, rect->h);
}
wonrst
  • 31
  • 1
0

I was not realized that elm_entry has a function for this:

Ecore_IMF_Context* imfctx = elm_entry_imf_context_get(myEntry);
ecore_imf_context_input_panel_event_callback_add(imfctx, ECORE_IMF_INPUT_PANEL_STATE_EVENT, on_input_panel_state_event, NULL);

This works just fine with the callback being:

void on_input_panel_state_event(void *data, Ecore_IMF_Context *ctx, int state)

state is a value from Ecore_IMF_Input_Panel_State, can be SHOW, HIDE or WILL_SHOW.

Daniel
  • 2,318
  • 2
  • 22
  • 53