18 lines
425 B
Python
18 lines
425 B
Python
import pygame
|
|
|
|
|
|
class InputManager:
|
|
QUIT = 0
|
|
|
|
def process_input(self) -> int:
|
|
last_input = None
|
|
|
|
for event in pygame.event.get():
|
|
if event.type == pygame.QUIT:
|
|
last_input = InputManager.QUIT
|
|
elif event.type == pygame.KEYDOWN:
|
|
if event.key == pygame.K_ESCAPE:
|
|
last_input = InputManager.QUIT
|
|
|
|
return last_input
|