| 3 | #include "MaaUtils/Logger.h" |
| 4 | |
| 5 | MAA_CTRL_UNIT_NS_BEGIN |
| 6 | |
| 7 | bool AdbShellInput::parse(const json::value& config) |
| 8 | { |
| 9 | static const json::array kDefaultClickArgv = { |
| 10 | "{ADB}", "-s", "{ADB_SERIAL}", "shell", "input tap {X} {Y}", |
| 11 | }; |
| 12 | static const json::array kDefaultSwipeArgv = { |
| 13 | "{ADB}", "-s", "{ADB_SERIAL}", "shell", "input swipe {X1} {Y1} {X2} {Y2} {DURATION}", |
| 14 | }; |
| 15 | static const json::array kDefaultClickKeyArgv = { |
| 16 | "{ADB}", "-s", "{ADB_SERIAL}", "shell", "input keyevent {KEY}", |
| 17 | }; |
| 18 | static const json::array kDefaultInputTextArgv = { |
| 19 | "{ADB}", "-s", "{ADB_SERIAL}", "shell", "input text '{TEXT}'", |
| 20 | }; |
| 21 | |
| 22 | return parse_command("Click", config, kDefaultClickArgv, click_argv_) && parse_command("Swipe", config, kDefaultSwipeArgv, swipe_argv_) |
| 23 | && parse_command("ClickKey", config, kDefaultClickKeyArgv, click_key_argv_) |
| 24 | && parse_command("InputText", config, kDefaultInputTextArgv, input_text_argv_); |
| 25 | } |
| 26 | |
| 27 | MaaControllerFeature AdbShellInput::get_features() const |
| 28 | { |
nothing calls this directly
no outgoing calls
no test coverage detected