close taskmanager after homepress 73/65873/2 accepted/tizen_3.0_common accepted/tizen_3.0_ivi accepted/tizen_common accepted/tizen_ivi accepted/tizen_mobile accepted/tizen_tv accepted/tizen_unified accepted/tizen_wearable tizen_3.0 tizen_3.0.m2 accepted/tizen/3.0/common/20161114.104944 accepted/tizen/3.0/ivi/20161011.065111 accepted/tizen/common/20160414.141848 accepted/tizen/ivi/20160414.011900 accepted/tizen/mobile/20160414.011941 accepted/tizen/tv/20160414.011858 accepted/tizen/unified/20170309.031039 accepted/tizen/wearable/20160414.011833 submit/tizen/20160413.222205 submit/tizen_3.0.m2/20170104.093748 submit/tizen_3.0_common/20161104.104000 submit/tizen_3.0_ivi/20161010.000007 submit/tizen_unified/20170308.100403
authorLukasz Stanislawski <l.stanislaws@samsung.com>
Wed, 13 Apr 2016 16:41:24 +0000 (18:41 +0200)
committerLukasz Stanislawski <l.stanislaws@samsung.com>
Wed, 13 Apr 2016 16:48:53 +0000 (18:48 +0200)
Change-Id: I32357b62398c1588bd138f0221dad97d407c5c29

src/main.c

index 539deee..9cf5ad1 100644 (file)
@@ -30,6 +30,7 @@
 #include "util.h"
 
 #define KEY_BACK "XF86Back"
+#define KEY_HOME "XF86Home"
 #define PRIVATE_DATA_KEY_LIST_TIMER "pri_list_tm"
 
 static main_s main_info = {
@@ -54,12 +55,12 @@ main_h main_get_info(void)
 
 
 
-static Eina_Bool _back_key_pressed(void *data, Evas_Object *obj, Evas_Object *src, Evas_Callback_Type type, void *event_info)
+static Eina_Bool _key_pressed(void *data, Evas_Object *obj, Evas_Object *src, Evas_Callback_Type type, void *event_info)
 {
-       _D("");
        Evas_Event_Key_Down *ev = event_info;
 
-       if (type == EVAS_CALLBACK_KEY_DOWN && strncmp(KEY_BACK, ev->key, strlen(KEY_BACK)) == 0) {
+       if (type == EVAS_CALLBACK_KEY_DOWN && ((strncmp(KEY_BACK, ev->key, strlen(KEY_BACK)) == 0) ||
+                       (strncmp(KEY_HOME, ev->key, strlen(KEY_HOME)) == 0))) {
                _D("KEY PRESSED: %s", ev->key);
 
                elm_exit();
@@ -165,7 +166,7 @@ static bool _create_cb(void *data)
        elm_win_screen_size_get(main_info.win, NULL, NULL, &main_info.root_w, &main_info.root_h);
        _D("screen size is (%d, %d)", main_info.root_w, main_info.root_h);
 
-       elm_object_event_callback_add(main_info.win, _back_key_pressed, NULL);
+       elm_object_event_callback_add(main_info.win, _key_pressed, NULL);
 
        elm_win_indicator_mode_set(main_info.win, ELM_WIN_INDICATOR_SHOW);
        elm_win_indicator_opacity_set(main_info.win, ELM_WIN_INDICATOR_TRANSPARENT);