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

Method input_text

source/MaaAdbControlUnit/Input/MaatouchInput.cpp:58–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56}
57
58bool MaatouchInput::input_text(const std::string& text)
59{
60 LogInfo << VAR(text);
61
62 if (!pipe_ios_) {
63 LogError << "pipe_ios_ is nullptr";
64 return false;
65 }
66
67 // https://github.com/MaaAssistantArknights/MaaTouch
68 static constexpr std::string_view kTextFormat = "t {}\nc\n";
69
70 bool ret = pipe_ios_->write(std::format(kTextFormat, text));
71
72 if (!ret) {
73 LogError << "failed to write";
74 return false;
75 }
76
77 return true;
78}
79
80bool MaatouchInput::key_down(int key)
81{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected