From f72e7bcdf39b084e7138e78a54218c63e1a644c8 Mon Sep 17 00:00:00 2001 From: MistEO Date: Wed, 21 Dec 2022 22:58:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dminitouch=E9=87=8D?= =?UTF-8?q?=E8=BF=9E=E6=97=B6=E5=8F=AF=E8=83=BD=E5=AD=98=E5=9C=A8=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MaaCore/Controller.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/MaaCore/Controller.cpp b/src/MaaCore/Controller.cpp index 40d72ec187..148920a7a8 100644 --- a/src/MaaCore/Controller.cpp +++ b/src/MaaCore/Controller.cpp @@ -411,9 +411,14 @@ std::optional asst::Controller::call_command(const std::string& cmd is_reconnect_success = reconnect_str.find("error") == std::string::npos; } if (is_reconnect_success) { - if (call_and_hup_minitouch()) { + if (m_minitouch_enabled && call_and_hup_minitouch()) { + Log.error("reconnected with minitouch"); m_minitouch_available = true; } + else { + Log.error("reconnected without minitouch"); + m_minitouch_available = false; + } auto recall_ret = call_command(cmd, timeout, false /* 禁止重连避免无限递归 */, recv_by_socket); if (recall_ret) { // 重连并成功执行了 @@ -1111,7 +1116,7 @@ bool asst::Controller::click_without_scale(const Point& p) } if (m_minitouch_enabled && m_minitouch_available) { - Log.info("minitouch click:", p); + Log.info(m_use_maa_touch ? "maatouch" : "minitouch", "click:", p); Minitoucher toucher(std::bind(&Controller::input_to_minitouch, this, std::placeholders::_1), m_minitouch_props); return toucher.down(p.x, p.y) && toucher.up(); } @@ -1161,7 +1166,8 @@ bool asst::Controller::swipe_without_scale(const Point& p1, const Point& p2, int const auto& opt = Config.get_options(); if (m_minitouch_enabled && m_minitouch_available) { - Log.info("minitouch swipe", p1, p2, duration, extra_swipe, slope_in, slope_out); + Log.info(m_use_maa_touch ? "maatouch" : "minitouch", "swipe", p1, p2, duration, extra_swipe, slope_in, + slope_out); Minitoucher toucher(std::bind(&Controller::input_to_minitouch, this, std::placeholders::_1), m_minitouch_props); toucher.down(x1, y1);