Set key repeats and re-compile keymap file 09/67709/4 accepted/tizen/common/20160504.125049 accepted/tizen/ivi/20160503.011740 accepted/tizen/mobile/20160503.011644 accepted/tizen/tv/20160503.011706 accepted/tizen/wearable/20160503.011724 submit/tizen/20160502.104143
authorJengHyun Kang <jhyuni.kang@samsung.com>
Thu, 28 Apr 2016 06:23:44 +0000 (15:23 +0900)
committerJengHyun Kang <jhyuni.kang@samsung.com>
Fri, 29 Apr 2016 01:24:12 +0000 (10:24 +0900)
Change-Id: I42d4a2470948746e4103c75f3b2a7f7783d73747

src/e_mod_keyrouter_conf.c
src/e_mod_main_wl.c
src/e_mod_main_wl.h

index 0d13e30..868eac6 100644 (file)
@@ -13,6 +13,7 @@ e_keyrouter_conf_init(E_Keyrouter_Config_Data *kconfig)
    E_CONFIG_VAL(D, T, name, STR);
    E_CONFIG_VAL(D, T, keycode, INT);
    E_CONFIG_VAL(D, T, no_privcheck, INT);
+   E_CONFIG_VAL(D, T, repeat, INT);
 
    kconfig->conf_edd = E_CONFIG_DD_NEW("Keyrouter_Config", E_Keyrouter_Conf_Edd);
 #undef T
index d4dab8f..15895f8 100644 (file)
@@ -492,6 +492,8 @@ _e_keyrouter_query_tizen_key_table(void)
    E_Keyrouter_Conf_Edd *kconf = krt->conf->conf;
    Eina_List *l;
    E_Keyrouter_Tizen_HWKey *data;
+   int res;
+   struct xkb_rule_names names={0,};
 
    /* TODO: Make struct in HardKeys to pointer.
                   If a key is defined, allocate memory to pointer,
@@ -515,7 +517,30 @@ _e_keyrouter_query_tizen_key_table(void)
         krt->HardKeys[data->keycode].keycode = data->keycode;
         krt->HardKeys[data->keycode].keyname = (char *)eina_stringshare_add(data->name);
         krt->HardKeys[data->keycode].no_privcheck = data->no_privcheck ? EINA_TRUE : EINA_FALSE;
+        krt->HardKeys[data->keycode].repeat = data->repeat ? EINA_TRUE : EINA_FALSE;
+
+        if (e_comp_wl_input_keymap_cache_file_use_get() == EINA_FALSE)
+          {
+             if (krt->HardKeys[data->keycode].repeat == EINA_FALSE)
+               {
+                  res = xkb_keymap_key_set_repeats(e_comp_wl->xkb.keymap, data->keycode, 0);
+                  if (!res)
+                    {
+                       KLWRN("Failed to set repeat key(%d), value(%d)\n", data->keycode, 0);
+                    }
+               }
+          }
+     }
+
+   if (e_comp_wl_input_keymap_cache_file_use_get() == EINA_FALSE)
+     {
+        KLINF("Server create a new cache file: %s\n", e_comp_wl_input_keymap_path_get(names));
+        res = unlink(e_comp_wl_input_keymap_path_get(names));
+
+        e_comp_wl_input_keymap_set(NULL, NULL, NULL, xkb_context_ref(e_comp_wl->xkb.context), e_comp_wl->xkb.keymap);
      }
+   else
+     KLINF("Currently cache file is exist. Do not change it.\n");
 
    return EINA_TRUE;
 }
index 04d0d13..3f252ed 100644 (file)
@@ -88,6 +88,7 @@ struct _E_Keyrouter_Tizen_HWKey
    char *name;
    int keycode;
    int no_privcheck;
+   int repeat;
 };
 
 struct _E_Keyrouter_Grabbed_Key
@@ -95,6 +96,7 @@ struct _E_Keyrouter_Grabbed_Key
    int keycode;
    char* keyname;
    Eina_Bool no_privcheck;
+   Eina_Bool repeat;
 
    Eina_List *excl_ptr;
    Eina_List *or_excl_ptr;