event handler sleep timer included, for less cpu usage
This commit is contained in:
parent
a46cf22eb1
commit
43e0d0dc43
@ -79,6 +79,8 @@ def handle_events():
|
||||
else:
|
||||
if event.type == pygame.QUIT or event.type == KEYDOWN:
|
||||
exit_application()
|
||||
|
||||
time.sleep(0.1)
|
||||
return
|
||||
|
||||
def exit_application():
|
||||
@ -90,11 +92,10 @@ def exit_application():
|
||||
def shutdown_raspberry():
|
||||
os.system("sudo shutdown -h now")
|
||||
return
|
||||
|
||||
|
||||
#signal handing for controlled exit via ctrl+c
|
||||
signal.signal(signal.SIGINT, signal_handler)
|
||||
|
||||
|
||||
pygame.mouse.set_visible(False) # hide mouse
|
||||
|
||||
screen = pygame.display.set_mode((screenSizeX, screenSizeY), pygame.FULLSCREEN)
|
||||
|
Loading…
Reference in New Issue
Block a user