How to handle hardware button "Back" on Tizen platform using EFL library

2.2k Views Asked by At

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?

4

There are 4 best solutions below

0
On BEST ANSWER

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
0
On

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.

0
On

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.

0
On

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