pygame.mouse.get_pos() #-> get the mouse cursor position on the screen in taple
#-> (x, y)
if event.type == pygame.MOUSEBUTTONDOWN:
print(event.button)
#------------------------#
1 - left click
2 - middle click
3 - right click
4 - scroll up
5 - scroll down
#------------------------#
while...: #your loop
button = pygame.Rect(cordX, cordY, width, height) #your bytton
pygame.draw.rect(win, (0, 0, 0), button) #show button
mx, my = pygame.mouse.get_pos() #mouse pos
if button.collidepoint((mx, my)): #cheak if mouse on button
if pygame.mouse.get_pressed()[0]: #cheak if mouse is preesed
# writh here what you want to happend
pygame.display.update()