Terminate on key release.

This commit is contained in:
Roz K 2022-12-23 10:25:37 +01:00
parent 34277274a3
commit 7ed23a5d5f
Signed by: roz
GPG Key ID: 51FBF4E483E1C822

View File

@ -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