It's exactly what the title is.
Is there a way to distinguish left-click or right-click in Pygame?
if event.type == MOUSEBUTTONDOWN:
If you use MOUSEBUTTONDOWN or MOUSEBUTTONUP like this, Turning the mouse wheel is also recognized by clicking, making it possible to make a wide circle. How do you distinguish left-click from right-click?
python pygame
I searched for you instead:
According to the link above...
if event.type == pygame.MOUSEBUTTONDOWN:
print(event.button)
Separate by the value of event.button
:
778 GDB gets version error when attempting to debug with the Presense SDK (IDE)
1260 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
775 Error in x, y, and format string must not be None
871 Uncaught (inpromise) Error on Electron: An object could not be cloned
© 2025 OneMinuteCode. All rights reserved.