summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2020-03-25 22:01:06 +0100
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2020-03-25 22:13:28 +0100
commit43f95ec6b3be726df4f8b834d9f3821a11096a6e (patch)
tree742267b7935774172b9b8514e7a020639f1bbdde
parent91b3476d515255eb5b6a8ed78b879f05eda5d3f3 (diff)
suite_helpers: add helper for key down events
usefull for emulating key events.
-rw-r--r--src/tests/elementary/suite_helpers.c15
-rw-r--r--src/tests/elementary/suite_helpers.h1
2 files changed, 16 insertions, 0 deletions
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
806 evas_event_feed_multi_up(e, 1, x2 + idx2, y2 + idy2, 1, 1, 1, 1, 0, x2 + idx2, y2 + idy2, 0, ts++, NULL); 806 evas_event_feed_multi_up(e, 1, x2 + idx2, y2 + idy2, 1, 1, 1, 1, 0, x2 + idx2, y2 + idy2, 0, ts++, NULL);
807 return i - 2; 807 return i - 2;
808} 808}
809
810void
811write_key_sequence(Eo *obj, const char *seqence)
812{
813 Evas *e = evas_object_evas_get(obj);
814 for (unsigned int i = 0; i < strlen(seqence); ++i)
815 {
816 const char part_seq[] = {seqence[i], '\0'};
817
818 evas_event_feed_key_down(e, part_seq, part_seq, part_seq, part_seq, 0, NULL);
819 ecore_main_loop_iterate();
820 evas_event_feed_key_up(e, part_seq, part_seq, part_seq, part_seq, 0, NULL);
821 ecore_main_loop_iterate();
822 }
823}
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);
35void multi_click_object_at(Eo *obj, int x, int y, int ids); 35void multi_click_object_at(Eo *obj, int x, int y, int ids);
36void multi_press_object_at(Eo *obj, int x, int y, int ids); 36void multi_press_object_at(Eo *obj, int x, int y, int ids);
37int multi_drag_object_around(Eo *obj, int touch_point, int cx, int cy, int radius, int degrees); 37int multi_drag_object_around(Eo *obj, int touch_point, int cx, int cy, int radius, int degrees);
38void write_key_sequence(Eo *obj, const char *seqence);
38void drag_object(Eo *obj, int x, int y, int dx, int dy, Eina_Bool iterate); 39void drag_object(Eo *obj, int x, int y, int dx, int dy, Eina_Bool iterate);
39int drag_object_around(Eo *obj, int cx, int cy, int radius, int degrees); 40int drag_object_around(Eo *obj, int cx, int cy, int radius, int degrees);
40int pinch_object(Eo *obj, int x, int y, int x2, int y2, int dx, int dy, int dx2, int dy2); 41int pinch_object(Eo *obj, int x, int y, int x2, int y2, int dx, int dy, int dx2, int dy2);