From 83b9e632dcd95963d5eec4c5148b9e5b2ceed303 Mon Sep 17 00:00:00 2001 From: Daniel Zaoui Date: Sun, 28 Feb 2016 14:55:21 +0200 Subject: [PATCH] Add F3 key to record scenario During ecore_shutdown, when the refcount reached 0, the scenario record has to be done. The problem is that the ecore termination never happens because of ecore modules loaded during init that references ecore refcount. The solution, until this is fixed, is to trigger the scenario recording from a key press. --- src/lib/tsuite_evas_hook.c | 43 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/src/lib/tsuite_evas_hook.c b/src/lib/tsuite_evas_hook.c index d133584..ee3e7b7 100644 --- a/src/lib/tsuite_evas_hook.c +++ b/src/lib/tsuite_evas_hook.c @@ -14,6 +14,7 @@ #define TSUITE_MAX_PATH 1024 #define SHOT_KEY_STR "F2" +#define SAVE_KEY_STR "F3" #define IMAGE_FILENAME_EXT ".png" /* START - EET Handling code */ @@ -905,6 +906,18 @@ evas_event_feed_key_down(Evas *e, const char *keyname, const char *key, return; } + if (!strcmp(key, SAVE_KEY_STR)) + { + if (_hook_setting) + { + if (vr_list && _hook_setting->recording) + write_events(_hook_setting->file_name, vr_list); +#ifdef DEBUG_TSUITE + printf("Save events: %s timestamp=<%u>\n", __func__, timestamp); +#endif + } + return; + } if (vr_list && _hook_setting->recording) { /* Construct duplicate strings, free them when list if freed */ @@ -941,6 +954,15 @@ evas_event_feed_key_up(Evas *e, const char *keyname, const char *key, return; /* Take screenshot done on key-down */ } + if (!strcmp(key, SAVE_KEY_STR)) + { +#ifdef DEBUG_TSUITE + printf("Save events: %s timestamp=<%u>\n", __func__, timestamp); +#endif + orig(e, keyname, key, string, compose, timestamp, data); + return; /* Save events done on key-down */ + } + int evt = { tsuite_event_type_get(EVAS_CALLBACK_KEY_UP) }; #ifdef DEBUG_TSUITE printf("Calling %s timestamp=<%u>\n", __func__, timestamp); @@ -988,6 +1010,18 @@ evas_event_feed_key_down_with_keycode(Evas *e, const char *keyname, const char * return; } + if (!strcmp(key, SAVE_KEY_STR)) + { + if (_hook_setting) + { + if (vr_list && _hook_setting->recording) + write_events(_hook_setting->file_name, vr_list); +#ifdef DEBUG_TSUITE + printf("Save events: %s timestamp=<%u>\n", __func__, timestamp); +#endif + } + return; + } if (vr_list && _hook_setting->recording) { /* Construct duplicate strings, free them when list if freed */ @@ -1025,6 +1059,15 @@ evas_event_feed_key_up_with_keycode(Evas *e, const char *keyname, const char *ke return; /* Take screenshot done on key-down */ } + if (!strcmp(key, SAVE_KEY_STR)) + { +#ifdef DEBUG_TSUITE + printf("Save events: %s timestamp=<%u>\n", __func__, timestamp); +#endif + orig(e, keyname, key, string, compose, timestamp, data, keycode); + return; /* Save events done on key-down */ + } + int evt = TSUITE_EVENT_KEY_UP_WITH_KEYCODE; #ifdef DEBUG_TSUITE printf("Calling %s timestamp=<%u>\n", __func__, timestamp);