From c0a40f40228a3bfb0cd4626d2497506fc141423b Mon Sep 17 00:00:00 2001 From: Balthasar Reuter Date: Sun, 31 May 2015 00:11:27 +0200 Subject: [PATCH] Event queue is now cleared on entering the loop --- photobooth.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/photobooth.py b/photobooth.py index fbf8c67..5ce10be 100755 --- a/photobooth.py +++ b/photobooth.py @@ -230,6 +230,8 @@ class GUI_PyGame: def mainloop(self, filename): while True: + # Ignore all input that happened before entering the loop + eventmodule.get() # Clear display self.clear() # Show idle-picture and message @@ -245,8 +247,6 @@ class GUI_PyGame: elif event.type == pygame.KEYDOWN: handle_keypress(event.key) elif event.type == pygame.MOUSEBUTTONUP: handle_mousebutton(event.button, event.pos) elif event.type == gpio_trigger_event: handle_gpio_event(event.channel) - # Ignore all input that happened inbetween - eventmodule.get() def teardown(self): pygame.quit() @@ -339,7 +339,6 @@ def take_picture(): # Take pictures filenames = [i for i in range(4)] for x in range(4): - # filenames[x] = camera.take_picture(images.get_next()) filenames[x] = camera.take_picture("/tmp/photobooth_%02d.jpg" % x) # Show 'Wait'