bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=43f95ec6b3be726df4f8b834d9f3821a11096a6e

commit 43f95ec6b3be726df4f8b834d9f3821a11096a6e
Author: Marcel Hollerbach <m...@marcel-hollerbach.de>
Date:   Wed Mar 25 22:01:06 2020 +0100

    suite_helpers: add helper for key down events
    
    usefull for emulating key events.
---
 src/tests/elementary/suite_helpers.c | 15 +++++++++++++++
 src/tests/elementary/suite_helpers.h |  1 +
 2 files changed, 16 insertions(+)

diff --git a/src/tests/elementary/suite_helpers.c 
b/src/tests/elementary/suite_helpers.c
index 19ae04b301..e6c6441957 100644
--- a/src/tests/elementary/suite_helpers.c
+++ b/src/tests/elementary/suite_helpers.c
@@ -806,3 +806,18 @@ pinch_object(Eo *obj, int x, int y, int x2, int y2, int 
dx, int dy, int dx2, int
    evas_event_feed_multi_up(e, 1, x2 + idx2, y2 + idy2, 1, 1, 1, 1, 0, x2 + 
idx2, y2 + idy2, 0, ts++, NULL);
    return i - 2;
 }
+
+void
+write_key_sequence(Eo *obj, const char *seqence)
+{
+  Evas *e = evas_object_evas_get(obj);
+  for (unsigned int i = 0; i < strlen(seqence); ++i)
+    {
+       const char part_seq[] = {seqence[i], '\0'};
+
+       evas_event_feed_key_down(e, part_seq, part_seq, part_seq, part_seq, 0, 
NULL);
+       ecore_main_loop_iterate();
+       evas_event_feed_key_up(e, part_seq, part_seq, part_seq, part_seq, 0, 
NULL);
+       ecore_main_loop_iterate();
+    }
+}
diff --git a/src/tests/elementary/suite_helpers.h 
b/src/tests/elementary/suite_helpers.h
index 2a8e1d23e0..b2a394b981 100644
--- a/src/tests/elementary/suite_helpers.h
+++ b/src/tests/elementary/suite_helpers.h
@@ -35,6 +35,7 @@ void multi_press_object(Eo *obj, int ids);
 void multi_click_object_at(Eo *obj, int x, int y, int ids);
 void multi_press_object_at(Eo *obj, int x, int y, int ids);
 int multi_drag_object_around(Eo *obj, int touch_point, int cx, int cy, int 
radius, int degrees);
+void write_key_sequence(Eo *obj, const char *seqence);
 void drag_object(Eo *obj, int x, int y, int dx, int dy, Eina_Bool iterate);
 int drag_object_around(Eo *obj, int cx, int cy, int radius, int degrees);
 int pinch_object(Eo *obj, int x, int y, int x2, int y2, int dx, int dy, int 
dx2, int dy2);

-- 


Reply via email to