-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathevent.py
More file actions
19 lines (18 loc) · 673 Bytes
/
event.py
File metadata and controls
19 lines (18 loc) · 673 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import pygame
def HandleEvent(clicked, pause, showUI, showValues):
running = True
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
if event.type == pygame.MOUSEBUTTONUP:
clicked = True
if event.type == pygame.KEYUP:
if event.key == pygame.K_ESCAPE:
running = False
if event.key == pygame.K_p:
pause = not pause
if event.key == pygame.K_SPACE:
showUI = not showUI
if event.key == pygame.K_s:
showValues = not showValues
return running, clicked, pause, showUI, showValues