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