diff --git a/main.py b/main.py index dfa641e..053ff08 100644 --- a/main.py +++ b/main.py @@ -252,7 +252,7 @@ def getevent(): touch_index = 0 # 执行 adb shell getevent 命令并捕获输出 - process = subprocess.Popen(['adb', 'shell', 'getevent', '-l'], stdout=subprocess.PIPE) + process = subprocess.Popen(['adb', 'shell', 'getevent', '-l'], stdin=subprocess.PIPE, stdout=subprocess.PIPE) key_is_changed = False # 读取实时输出 @@ -338,7 +338,9 @@ if __name__ == "__main__": serial_manager.start() threading.Thread(target=getevent).start() while True: - input_str = input() + input_str = input().strip() + if len(input_str) == 0: + continue if input_str == 'start': serial_manager.startUp = True print("已连接到游戏") diff --git a/start.bat b/start.bat index 51020fb..1568968 100644 --- a/start.bat +++ b/start.bat @@ -1,3 +1,2 @@ @echo off python .\main.py -pause \ No newline at end of file