Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the method of AWTK input event recording and playback

2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

The main content of this article is to explain "what is the method of AWTK input event recording and playback", interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "what is the method of AWTK input event recording and playback"!

Enter event recording and playback 1. Use

Common uses for input event recording and playback are:

Automatic demonstration function.

Run for a long time for stress testing.

Assist with manual testing. Sometimes when a crashed BUG occurs, you often forget how it was done before, and input event logging and playback can accurately reproduce the problem. At the same time, the workload of manual testing can be reduced.

2. API @ method event_recorder_player_start_record * starts event recording. * @ annotation ["static"] * @ param {const char*} filename the file name used to save the event. * * @ return {ret_t} returns RET_OK to indicate success, otherwise it means failure. * / ret_t event_recorder_player_start_record (const char* filename); / * * @ method event_recorder_player_start_play * starts event playback. * @ annotation ["static"] * @ param {const char*} filename holds the file name of the event. * @ param {uint32_t} the number of times times plays in a loop. * * @ return {ret_t} returns RET_OK to indicate success, otherwise it means failure. * / ret_t event_recorder_player_start_play (const char* filename, uint32_t times); / * * @ method event_recorder_player_stop_record * stop event recording. * @ annotation ["static"] * * @ return {ret_t} returns RET_OK to indicate success, otherwise it means failure. * / ret_t event_recorder_player_stop_record (void); / * * @ method event_recorder_player_stop_play * stop event playback. * @ annotation ["static"] * * @ return {ret_t} returns RET_OK to indicate success, otherwise it means failure. / ret_t event_recorder_player_stop_play (void); 3. Usage

There are generally two ways to enable input event logging and playback:

Start the recording or playback function with command-line arguments (no examples are provided at this time).

Use keyboard shortcuts to start recording and playback functions. This method is more flexible, can be enabled and stopped at any time, and can be recorded and played at any time.

You need to define the macro WITH | _ EVENT_RECORDER_PLAYER to enable event logging and playback, which is defined by default in the PC version.

Demoui demonstrates the ability to start recording and playback through keyboard shortcuts:

# include "base/event_recorder_player.h"... static ret_t on_key_record_play_events (void* ctx, event_t* e) {key_event_t* evt = (key_event_t*) epositional ifdef WITH_EVENT_RECORDER_PLAYER if (evt- > key = = TK_KEY_F5) {event_recorder_player_start_record ("event_log.bin"); return RET_STOP } else if (evt- > key = = TK_KEY_F6) {event_recorder_player_stop_record (); return RET_STOP;} else if (evt- > key = = TK_KEY_F7) {event_recorder_player_start_play ("event_log.bin", 0xffff); return RET_STOP;} else if (evt- > key = = TK_KEY_F8) {event_recorder_player_stop_play (); return RET_STOP } # endif / * WITH_EVENT_RECORDER_PLAYER*/ return RET_OK;}... widget_on (wm, EVT_KEY_UP, on_key_record_play_events, wm)

In the above code:

F5 key to start recording.

F6 key stops recording.

F7 key to start playing.

F8 key to stop playback.

4. Known problem

If you want to repeat the recorded event, make sure that when you record the event, you will not stop recording until you return to the initial interface.

At present, the input event of the native input method of the platform is not recorded.

At this point, I believe you have a deeper understanding of "what is the method of AWTK input event recording and playback". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report