Question

I use EFL library to develop applications for Tizen platform. I need to implement event handler for hardware button "Back".

In native Tizen API it is done pretty simple. But I have no idea how can I do this in EFL library.

I tried to do it using the following way:

evas_object_event_callback_add( obj, EVAS_CALLBACK_KEY_DOWN, on_key_down, NULL );

But it doesn't work.

Could anyone help me?

Was it helpful?

Solution

Instead of EVAS_CALLBACK_KEY_DOWNandevas_object_event_callback_add()`,

  • use ea_object_event_callback_add
  • use EA_CALLBACK_BACK for back button
  • and EA_CALLBACK_MORE for menu button but you need to include one header file, unfortunately I forgot the header file name some thing efl-util.h or something, you can make a search in header files

OTHER TIPS

AFAIK the thing is that EFL uses queues for processing events. That means that callbacks are called one by one: the first should return PASS_ON (or something) for the next callback for the same event to be run.

So, there may be another callback that does not allow the dispatch of the event.

Try

Ecore_Event_Handler *handler;
handler = ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, hardware_key_down_cb, NULL);

In hardware_key_down_cb() callback function, check for key name 'XF86Stop' Ecore_Event_Key to handle back key event.

use eext_object_event_callback_add(Evas_Object * obj,eext_callback_type type,callback_fun,NULL) and in call back function you can write your requirement

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top