Languages

Menu
Sites
Language
Exit keyboard (entry) when done clicked

I have configured an entry (keyboard) to replace the return key with 'DONE'.  This is a single line entry.

Now I would like clicking the done key to trigger closing the keyboard.  How should I do this?

1. Do I have to listen for every change to the text awaiting a '\n' ?  If so how.

2. Do I have to manually remove the '\n' from the text after I get it from the entry component?  Or can I prevent the '\n' from being inserted/appended to the entry text?

 

I could not find a signal from the Entry that would indicate done was clicked.  I seem to recall that I read that somewhere, but can't find where that signal would be.

 

Edited by: Michelle Dupuis on 19 Aug, 2019

Responses

1 Replies
UK

I solved it like this:

To the entry object, I added: evas_object_smart_callback_add(ad->entry, "activated", on_entry_activated, ad). This triggers when Done is pressed.

In on_entry_activated, after processing the input (using elm_entry_entry_get(ad->entry)), I hid the keyboard with elm_entry_input_panel_hide(ad->entry).