import pygame, sys from pygame.locals import * pygame.init() display = pygame.display.set_mode((300, 300)) FPS_CLOCK = pygame.time.Clock() # clock while 1: for event in pygame.event.get(): if event.type == QUIT: pygame.quit() sys.exit() left, middle, right = pygame.mouse.get_pressed() # Left click, middle click, right click if left: # If left mouse key print("Left Mouse Key is being pressed") print(pygame.mouse.get_pos()) # Gets the position of the mouse cursor print(pygame.mouse.get_rel()) # Gets the coordinates of how the position of the mouse cursor has changed since the last call pygame.display.update() FPS_CLOCK.tick(30) # clock # pygame.mouse.set_visible - used to make the mouse cursor visible and invisible (put true or false in brackets) # collidepoint() - takes a set of coordinates, and determines whether they are colliding with the rect