Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to get left click input in pygame

run = True
while run:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            run = False

        if event.type == pygame.MOUSEBUTTONDOWN:
            if event.button == 1:
                print("left mouse button")
            elif event.button == 2:
                print("middle mouse button")
            elif event.button == 3:
                print("right mouse button")
            elif event.button == 4:
                print("mouse wheel up")
            elif event.button == 5:
                print("mouse wheel down")
Comment

PREVIOUS NEXT
Code Example
Python :: How to change application icon of pygame 
Python :: mathtext to regular python 
Python :: filter function in python 
Python :: # convert string to date 
Python :: python integers 
Python :: base64 python 
Python :: django-storages delete folder 
Python :: loading bar python 
Python :: 151 problem solution 
Python :: 2 functions at a time py 
Python :: list vs dictionary python 
Python :: create feature dataset arcpy 
Python :: python stop stdout 
Python :: wordcount pyspark 
Python :: How to convert datetime in python 
Python :: avoid bad request django 
Python :: how to input a full array in one input in python 
Python :: python convert docx to pdf 
Python :: plotting mean in density plot ggplot2 
Python :: toolbar pyqt 
Python :: aws django bucket setting 
Python :: python dict add item 
Python :: install tabula 
Python :: :: python 
Python :: check if variable is defined in python 
Python :: Fill in the gaps in the initials function so that it returns the initials of the words contained in the phrase received, in upper case. 
Python :: python check if string is float 
Python :: qdate to date 
Python :: 4D Array To DF 
Python :: airflow schedule interval timezone 
ADD CONTENT
Topic
Content
Source link
Name
8+1 =