Languages

Menu
Sites
Language
Listen for hardware keypress on native WATCH application

Hello,

I'm currently working on developing a native watch application. I'm pretty new to Tizen, so I was hoping someone could help me out with this. Is there a way to listen for hardware keypresses (i.e. the home and back button on Galaxy Watch)? I tried using the efl_extension library with the eext_win_keygrab_set() function, but with no luck. Is there another possible way?

Thanks in advance,

Ryan

Responses

1 Replies
Paul L
Hello, try this:
 
hwKeyUpHandler = ecore_event_handler_add(ECORE_EVENT_KEY_UP, onHWKeyUpCb, this);
hwKeyDownHandler = ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, onHWKeyDownCb, this);
 
 
in callback function:
Ecore_Event_Key *event = (Ecore_Event_Key*)ev;
if(TextUtils::equals("XF86Home",event->key) ||
TextUtils::equals("XF86Phone",event->key) ||
TextUtils::equals("XF86PowerOff",event->key)){
}