update: fix subprocess input pipe bug

pull/7/head
ERR0RPR0MPT 2024-04-14 07:37:11 +08:00
parent 4deebfd23a
commit ee6a24f736
2 changed files with 4 additions and 3 deletions

View File

@ -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("已连接到游戏")

View File

@ -1,3 +1,2 @@
@echo off
python .\main.py
pause