Learn Before
Concept

EventTypes in Pygame

Pygame also has objects to store the type and attributes of a given event. The type is an integer that is stored inside a constant. These are EventType objects, and are themselves attributes of the Event object. Events of a certain type are guaranteed to have CERTAIN attributes. Here is a list of all event types and the attributes they each have:

TYPE ATTRIBUTE QUIT none ACTIVEEVENT gain, state KEYDOWN key, mod, unicode, scancode KEYUP key, mod MOUSEMOTION pos, rel, buttons MOUSEBUTTONUP pos, button MOUSEBUTTONDOWN pos, button JOYAXISMOTION joy (deprecated), instance_id, axis, value JOYBALLMOTION joy (deprecated), instance_id, ball, rel JOYHATMOTION joy (deprecated), instance_id, hat, value JOYBUTTONUP joy (deprecated), instance_id, button JOYBUTTONDOWN joy (deprecated), instance_id, button VIDEORESIZE size, w, h VIDEOEXPOSE none USEREVENT code

0

1

Updated 2021-07-28

Tags

Python Programming Language

Data Science

Learn After