#define DEVICED_OBJECT_PATH "/Org/Tizen/System/DeviceD"
#define DEVICED_INTERFACE_NAME DEVICED_BUS_NAME
+#define POWEROFF_KEY "XF86PowerOff"
+#define BACK_KEY "XF86Back"
+#define HOME_KEY "XF86Home"
+
int clicked_index = 0;
static void pm_state_changed(keynode_t *key, void *data);
}
}
+Eina_Bool KeyUpCb(void *data, int type, void *event)
+{
+ Ecore_Event_Key *e = event;
+ const struct popup_ops *ops = data;
+
+ if (!strncmp(e->key, BACK_KEY, sizeof(BACK_KEY)) || !strncmp(e->key, HOME_KEY, sizeof(HOME_KEY)))
+ {
+ _D("HOME_KEY or BACK KEY is pressed");
+ if (ops)
+ unload_simple_popup(ops);
+ terminate_if_no_popup();
+ }
+
+ // Let the event continue to other callbacks.
+ return ECORE_CALLBACK_PASS_ON;
+}
+
int powerkey_list(bundle *b, const struct popup_ops *ops)
{
Elm_Genlist_Item_Class *itc = elm_genlist_item_class_new();
box = elm_box_add(popup);
evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- /* back key */
- eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, event_back_key_up, (void*)ops);
+ /* back & home key */
+ ecore_event_handler_add(ECORE_EVENT_KEY_UP, KeyUpCb, (void*)ops);
/* genlist */
genlist = elm_genlist_add(box);