I'm not able to detect the event when Mouse button is pressed down.
Before asking this question I've tried:
import pygame, sys
pygame.init()
win = pygame.display.set_mode((1260, 960))
pygame.display.set_caption("PONG")
finish = False
fps = 60
clock = pygame.time.Clock()
while not finish:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
if event.type == pygame.KEYDOWN:
if event.key == pygame.MOUSEBUTTONDOWN:
print('MOUSE BUTTON PRESSED DOWN')
clock.tick(fps)
pygame.display.update()
What's wrong with the code?
Also, I'm not getting any errors in my terminal.