From 9f8247dc4da89219b6eede08d58d96964391a077 Mon Sep 17 00:00:00 2001 From: Viljami Ilola <+@hix.fi> Date: Sat, 27 Apr 2024 16:26:22 +0300 Subject: refactor menus and screen showing under menu subpkg --- src/sliceitoff/menu/anykey.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 src/sliceitoff/menu/anykey.py (limited to 'src/sliceitoff/menu/anykey.py') diff --git a/src/sliceitoff/menu/anykey.py b/src/sliceitoff/menu/anykey.py new file mode 100644 index 0000000..0916ec3 --- /dev/null +++ b/src/sliceitoff/menu/anykey.py @@ -0,0 +1,9 @@ +""" menu.anykey - Event waiting. Used for skipping screens. """ +import pygame + +def anykey(): + """ Anything but mouse movement gives True """ + for event in pygame.event.get(): + if event.type in (pygame.MOUSEBUTTONDOWN, pygame.KEYDOWN, pygame.QUIT): + return True + return False -- cgit v1.2.3