This commit is contained in:
2024-12-28 20:04:42 +01:00
parent 9efa31daf8
commit 5584b058db

View File

@@ -151,12 +151,13 @@ if __name__ == "__main__":
try:
while True:
if is_input_available():
input_char = sys.stdin.read(1).strip()
if input_char in ['w', 'a', 'd', 's']:
command_queue.put(input_char)
elif input_char == 'q':
print("Exiting...")
break
input_chars = sys.stdin.read().strip()
for char in input_chars:
if char in ['w', 'a', 'd', 's']:
command_queue.put(char)
elif char == 'q':
print("Exiting...")
exit()
while not command_queue.empty():
command = command_queue.get()