ecore_wl2: add keyboard repeat set API 96/172996/2
authorHosang Kim <hosang12.kim@samsung.com>
Mon, 19 Mar 2018 06:59:56 +0000 (15:59 +0900)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Mon, 19 Mar 2018 23:51:25 +0000 (23:51 +0000)
Application want to change keyboard repeat rate and delay time.

@tizen_only

Change-Id: Idb0c490f5d49849123c53b2828d2a50b74627b4a

src/lib/ecore_wl2/ecore_wl2_input.c
src/lib/ecore_wl2/ecore_wl2_private.h

index c2a89fe..07826bd 100644 (file)
@@ -1573,8 +1573,13 @@ _keyboard_cb_repeat_setup(void *data, struct wl_keyboard *keyboard EINA_UNUSED,
      }
 
    input->repeat.enabled = EINA_TRUE;
-   input->repeat.rate = (1.0 / rate);
-   input->repeat.delay = (delay / 1000.0);
+   //TIZEN_ONLY(20180319): add keyboard repeat info set/get API.
+   if (!input->repeat.changed)
+     {
+        input->repeat.rate = (rate / 1000.0);
+        input->repeat.delay = (delay / 1000.0);
+     }
+   //
    ev = malloc(sizeof(Ecore_Wl2_Event_Seat_Keymap_Changed));
    if (ev)
      {
@@ -2239,6 +2244,7 @@ _ecore_wl2_input_add(Ecore_Wl2_Display *display, unsigned int id, unsigned int v
    input->repeat.rate = 0.025;
    input->repeat.delay = 0.4;
    input->repeat.enabled = EINA_TRUE;
+   input->repeat.changed = EINA_FALSE;
 
    wl_array_init(&input->data.selection.types);
    wl_array_init(&input->data.drag.types);
@@ -3437,6 +3443,20 @@ ecore_wl2_input_keymap_get(const Ecore_Wl2_Input *input)
    return input->xkb.keymap;
 }
 
+//TIZEN_ONLY(20180319): add keyboard repeat info set/get API.
+EAPI Eina_Bool
+ecore_wl2_input_keyboard_repeat_set(Ecore_Wl2_Input *input, double rate, double delay)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(input, EINA_FALSE);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(input->display, EINA_FALSE);
+   EINA_SAFETY_ON_FALSE_RETURN_VAL(input->wl.keyboard, EINA_FALSE);
+   input->repeat.rate = rate;
+   input->repeat.delay = delay;
+   input->repeat.changed = EINA_TRUE;
+   return input->repeat.enabled;
+}
+//
+
 EAPI Eina_Bool
 ecore_wl2_input_keyboard_repeat_get(const Ecore_Wl2_Input *input, double *rate, double *delay)
 {
index 11d8af6..57fbd82 100755 (executable)
@@ -646,6 +646,9 @@ struct _Ecore_Wl2_Input
         double rate, delay;
         Eina_Bool enabled : 1;
         Eina_Bool repeating : 1;
+        //TIZEN_ONLY(20180319): add keyboard repeat info set/get API.
+        Eina_Bool changed : 1;
+        //
      } repeat;
 
    struct