1run = True
2while run:
3 for event in pygame.event.get():
4 if event.type == pygame.QUIT:
5 run = False
6
7 if event.type == pygame.MOUSEBUTTONDOWN:
8 if event.button == 1:
9 print("left mouse button")
10 elif event.button == 2:
11 print("middle mouse button")
12 elif event.button == 3:
13 print("right mouse button")
14 elif event.button == 4:
15 print("mouse wheel up")
16 elif event.button == 5:
17 print("mouse wheel down")
18