ecore/evas: add flag for repeat key event 32/291232/3
authorHosang Kim <hosang12.kim@samsung.com>
Wed, 12 Apr 2023 07:48:47 +0000 (16:48 +0900)
committerkim hosang <hosang12.kim@samsung.com>
Wed, 19 Apr 2023 08:21:43 +0000 (08:21 +0000)
Change-Id: I58ecb628dcbc5872c44c4609f421ba86bfabd445

src/lib/ecore/Ecore_Common.h
src/lib/ecore_wl2/ecore_wl2_input.c
src/lib/evas/Evas_Common.h
src/lib/evas/canvas/efl_input_types.eot
src/lib/evas/canvas/evas_events.c

index d45ff8b..1e03d90 100644 (file)
@@ -3475,14 +3475,15 @@ EAPI Ecore_Device_Subclass ecore_device_subclass_get(const Ecore_Device *dev);
 /**
  * @brief Flags for Events
  *
- * @since_tizen 5.5
+ * @since_tizen 7.5
  */
 typedef enum _Ecore_Event_Flags
 {
    ECORE_EVENT_FLAG_NONE = 0, /**< No fancy flags set */
    ECORE_EVENT_FLAG_ON_HOLD = (1 << 0), /**< This event is being delivered but should be put "on hold" until the on hold flag is unset. The event should be used for informational purposes and maybe some indications visually, but not actually perform anything */
    ECORE_EVENT_FLAG_ON_SCROLL = (1 << 1), /**< This event flag indicates the event occurs while scrolling; for example, DOWN event occurs during scrolling; the event should be used for informational purposes and maybe some indications visually, but not actually perform anything */
-   ECORE_EVENT_FLAG_CANCEL = (1 << 2) /**< This event flag indicates the event is canceled. The event should be used for informational purposes and maybe some indications visually, but not actually perform anything.*/
+   ECORE_EVENT_FLAG_CANCEL = (1 << 2), /**< This event flag indicates the event is canceled. The event should be used for informational purposes and maybe some indications visually, but not actually perform anything.*/
+   ECORE_EVENT_FLAG_REPEAT = (1 << 3) /**< This event flag indicates the event is repeated. The event should be used for informational purposes and maybe some indications visually, but not actually perform anything.*/
 } Ecore_Event_Flags;
 
 /**
index a2d680c..265ec67 100644 (file)
@@ -956,7 +956,7 @@ _ecore_wl2_keyboard_dev_get(Ecore_Wl2_Input *input, int window_id)
 }
 
 static void
-_ecore_wl2_input_key_send(Ecore_Wl2_Input *input, Ecore_Wl2_Window *window, xkb_keysym_t sym, xkb_keysym_t sym_name, unsigned int code, unsigned int state, unsigned int timestamp, Eina_Bool cancel)
+_ecore_wl2_input_key_send(Ecore_Wl2_Input *input, Ecore_Wl2_Window *window, xkb_keysym_t sym, xkb_keysym_t sym_name, unsigned int code, unsigned int state, unsigned int timestamp, Eina_Bool cancel, Eina_Bool repeat)
 {
    Ecore_Event_Key *ev;
    char key[256] = "", keyname[256] = "", compose[256] = "";
@@ -982,6 +982,8 @@ _ecore_wl2_input_key_send(Ecore_Wl2_Input *input, Ecore_Wl2_Window *window, xkb_
    ev->event_flags = ECORE_EVENT_FLAG_NONE;
    if (cancel)
      ev->event_flags |= ECORE_EVENT_FLAG_CANCEL;
+   if (repeat)
+     ev->event_flags |= ECORE_EVENT_FLAG_REPEAT;
 
    strcpy((char *)ev->keyname, keyname);
    strcpy((char *)ev->key, key);
@@ -1409,7 +1411,7 @@ _keyboard_cb_repeat(void *data)
                              input->repeat.sym, input->repeat.sym_name,
                              input->repeat.key + 8,
                              WL_KEYBOARD_KEY_STATE_PRESSED,
-                             input->repeat.time, EINA_FALSE);
+                             input->repeat.time, EINA_FALSE, EINA_TRUE);
 
    return ECORE_CALLBACK_RENEW;
 }
@@ -1526,7 +1528,7 @@ _keyboard_cb_key(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsigned
    else
      {
         _ecore_wl2_input_key_send(input, window, sym, sym_name, code,
-                                  state, timestamp, _key_event_cancel);
+                                  state, timestamp, _key_event_cancel, EINA_FALSE);
 
         if (!xkb_keymap_key_repeats(input->xkb.keymap, code)) return;
 
index df84cf9..5263bd7 100644 (file)
@@ -366,14 +366,15 @@ typedef enum _Evas_Button_Flags
 /**
  * @brief Flags for Events
  *
- * @since_tizen 5.5
+ * @since_tizen 7.5
  */
 typedef enum _Evas_Event_Flags
 {
    EVAS_EVENT_FLAG_NONE = 0, /**< No fancy flags set */
    EVAS_EVENT_FLAG_ON_HOLD = (1 << 0), /**< This event is being delivered but should be put "on hold" until the on hold flag is unset. The event should be used for informational purposes and maybe some indications visually, but not actually perform anything */
    EVAS_EVENT_FLAG_ON_SCROLL = (1 << 1), /**< This event flag indicates the event occurs while scrolling; for example, DOWN event occurs during scrolling; the event should be used for informational purposes and maybe some indications visually, but not actually perform anything */
-   EVAS_EVENT_FLAG_CANCEL = (1 << 2) /**< This event flag indicates the event is canceled. The event should be used for informational purposes and maybe some indications visually, but not actually perform anything.*/
+   EVAS_EVENT_FLAG_CANCEL = (1 << 2), /**< This event flag indicates the event is canceled. The event should be used for informational purposes and maybe some indications visually, but not actually perform anything.*/
+   EVAS_EVENT_FLAG_REPEAT = (1 << 3) /**< This event flag indicates the event is repeated. The event should be used for informational purposes and maybe some indications visually, but not actually perform anything.*/
 } Evas_Event_Flags;
 
 typedef enum _Evas_Aspect_Control
index 9f9d8cb..b768aef 100644 (file)
@@ -50,6 +50,10 @@ enum Efl.Input.Flags
                           The event should be used for informational purposes
                           and maybe some indications visually, but not actually
                           perform anything.]]
+   repeated = (1 << 3), [[This event flag indicates the event is repeated.
+                          The event should be used for informational purposes
+                          and maybe some indications visually, but not actually
+                          perform anything.]]
 }
 
 enum Efl.Input.Object_Pointer_Mode {
index d3014a6..2284498 100644 (file)
@@ -3744,7 +3744,7 @@ _canvas_event_feed_key_down_internal(Evas_Public_Data *e, Efl_Input_Key_Data *ev
    evt = ev->eo;
    ev->modifiers = &(e->modifiers);
    ev->locks = &(e->locks);
-   ev->event_flags = (Efl_Input_Flags)e->default_event_flags;
+   ev->event_flags |= (Efl_Input_Flags)e->default_event_flags;
    if (ev->device) efl_ref(ev->device);
 
    if (e->grabs)