Pygame Module - event.type()

# In Pygame, `event.type` represents the type of event. Pygame supports many different types of events to respond to user input, window operations, etc. The following are some common event.type():
# 1. `pygame.QUIT`: Window close event, triggered when the user clicks the close button of the window.
# 2. `pygame.KEYDOWN`: Keyboard key press event, triggered when the user presses a keyboard key.
# 3. `pygame.KEYUP`: Keyboard key release event, triggered when the user releases a keyboard key.
# 4. `pygame.MOUSEBUTTONDOWN`: Mouse button press event, triggered when the user presses the mouse button.
# 5. `pygame.MOUSEBUTTONUP`: Mouse button release event, triggered when the user releases the mouse button.
# 6. `pygame.MOUSEMOTION`: Mouse movement event, triggered when the user moves the mouse.
# 7. `pygame.MOUSEWHEEL`: Mouse wheel event, triggered when the user rolls the mouse wheel.
# 8. `pygame.VIDEORESIZE`: Window size adjustment event, triggered when the window size is adjusted.
# 9. `pygame.USEREVENT`: User-defined event, you can use `pygame.USEREVENT` as the event type to create your own custom event.
# 10. Some other event types are used to handle specific situations such as audio, timers, focus changes, etc.

Guess you like

Origin blog.csdn.net/Alexandra_Zero/article/details/132835420