I want to have the type of an event from the event queue to decide certain actions (i.e. if it is a joystick event or a keyboard one), but the dir
of events is an empty list:
for e in pygame.event.get():
print dir(e)
Although in the documentation i read:
The queue is a regular queue of pygame.event.EventTypepygame object for representing SDL events event objects
i can't access a __dict__
attribute. The above code prints a bunch of empty lists: [] [] [] []
etc. In pygame 1.9.4 installed from pip i could run:
if e.type == pygame.JOYBUTTONDOWN:
e.__dict__["joy"]
and i could get the number of joystick button pressed, but this is not working in 1.9.4 installed with sudo apt install
(on Debian):
print event.__dict__
AttributeError: event member not defined