MCPcopy Create free account
hub / github.com/MaaXYZ/MaaFramework / parse

Method parse

source/MaaAdbControlUnit/Input/AdbShellInput.cpp:5–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3#include "MaaUtils/Logger.h"
4
5MAA_CTRL_UNIT_NS_BEGIN
6
7bool 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
27MaaControllerFeature AdbShellInput::get_features() const
28{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected