1pygame.mouse.get_pos() #-> get the mouse cursor position on the screen in taple
2#-> (x, y)
3
4if event.type == pygame.MOUSEBUTTONDOWN:
5 print(event.button)
6
7#------------------------#
81 - left click
92 - middle click
103 - right click
114 - scroll up
125 - scroll down
13#------------------------#
1x,y = pygame.mouse.get_pos()
2#get the mouse cursor position
3#get_pos() -> (x, y)
4#Returns the X and Y position of the mouse cursor.
5#The position is relative to the top-left corner of the display.
6#The cursor position can be located outside of the display window,
7#but is always constrained to the screen.
1 pygame.mouse.get_pos()
2 get the mouse cursor position
3 get_pos() -> (x, y)
4
5 Returns the x and y position of the mouse cursor.
6 The position is relative to the top-left corner of the display.
7 The cursor position can be located outside of the display window,
8 but is always constrained to the screen.