Answers for "get mouse click pygame and if its left click"

C
3

how to detect mouse click in pygame

while running: # Gameloop
  for event in pygame.event.get(): # Checks all events
    if event.type == pygame.MOUSEBUTTONDOWN: # If the current event is the mouse button down event
      pos = pygame.mouse.get_pos() # Stores the mouse position
Posted by: Guest on July-26-2021
0

pygame left click

if event.type == pygame.MOUSEBUTTONDOWN:
  if event.button == 1:
    print("Left Mouse Button Down!")
Posted by: Guest on April-13-2021

Code answers related to "C"

Browse Popular Code Answers by Language