mirror of
https://gitee.com/jiuyilian/embedded-framework.git
synced 2025-10-24 18:20:15 -04:00
1.3 KiB
1.3 KiB
Monkey
A simple monkey test. Use random input to stress test the application.
Usage
Enable LV_USE_MONKEY in lv_conf.h.
First configure monkey, use lv_monkey_config_t to define the configuration structure, set the type (check input devices for the supported types), and then set the range of period_range and input_range, the monkey will output random operations at random times within this range. Call lv_monkey_create to create monkey. Finally call lv_monkey_set_enable(monkey, true) to enable monkey.
If you want to pause the monkey, call lv_monkey_set_enable(monkey, false). To delete the monkey, call lv_monkey_del(monkey).
Note that input_range has different meanings in different type:
LV_INDEV_TYPE_POINTERNo effect, click randomly within the pixels of the screen resolution.LV_INDEV_TYPE_ENCODERThe minimum and maximum values ofenc_diff.LV_INDEV_TYPE_BUTTONThe minimum and maximum values ofbtn_id. Uselv_monkey_get_indev()to get the input device, and uselv_indev_set_button_points()to map the key ID to the coordinates.LV_INDEV_TYPE_KEYPADNo effect, Send random Keys.
Example
.. include:: ../../examples/others/monkey/index.rst
API
.. doxygenfile:: lv_monkey.h
:project: lvgl