| 56 | } |
| 57 | |
| 58 | bool 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 | |
| 80 | bool MaatouchInput::key_down(int key) |
| 81 | { |
nothing calls this directly
no outgoing calls
no test coverage detected