event handler sleep timer included, for less cpu usage
This commit is contained in:
		@@ -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():
 | 
			
		||||
@@ -94,7 +96,6 @@ def shutdown_raspberry():
 | 
			
		||||
#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)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user