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);