diff --git a/game/game.py b/game/game.py index 3744743..73f62a0 100644 --- a/game/game.py +++ b/game/game.py @@ -154,6 +154,7 @@ def main(): clouds_orientation = tests_batch.params[clouds_id].orientation print("Running...") + events = buffer(Event, 16) start_time = time.monotonic() current_time = 0.0 frame_min = 10000.0 @@ -236,6 +237,19 @@ def main(): frame_max = max(frame_max, frame_ms) frame_avg += frame_ms perf_count += 1 + + stop = False + while True: + nevents = consume_events(events, len(events)) + if not nevents: + break + for event in events[:nevents]: + if event.type == EVENT_KEY_RELEASE: + print("EVENT_KEY_RELEASE:", event.data.key.keycode) + stop = True + if stop: + break + except KeyboardInterrupt: pass