From 6b5627820e990c813d8ead86a0789b3ceb94546e Mon Sep 17 00:00:00 2001 From: RainbowC0 <15760207563@139.com> Date: Fri, 18 Apr 2025 10:27:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dadb=20shell=E8=BF=90=E8=A1=8C?= =?UTF-8?q?=E6=97=B6/dev/input/eventX=E6=89=93=E5=BC=80=E5=A4=B1=E8=B4=A5?= =?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/tools/tools.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/tools.cpp b/src/tools/tools.cpp index ba73f8f..557610c 100644 --- a/src/tools/tools.cpp +++ b/src/tools/tools.cpp @@ -54,7 +54,7 @@ void touch::InitTouchScreenInfo() { for (const auto &entry : std::filesystem::directory_iterator("/dev/input/")) { - int fd = open(entry.path().c_str(), O_RDWR); + int fd = open(entry.path().c_str(), O_RDONLY); if (fd < 0) { Log(ANDROID_LOG_WARN,TAG, "%s", std::string ("打开 "+entry.path().string()+"失败").c_str()); @@ -64,7 +64,7 @@ void touch::InitTouchScreenInfo() if (absinfo.maximum == 9) { Log(ANDROID_LOG_INFO,TAG, "%s", std::string ("找到疑似触摸节点: "+entry.path().string()).c_str()); - this->touchScreenInfo.fd.emplace_back(open(entry.path().c_str(), O_RDWR)); + this->touchScreenInfo.fd.emplace_back(open(entry.path().c_str(), O_RDONLY)); if (touchScreenInfo.width == 0 || touchScreenInfo.height == 0) {