python - How to properly use pygame.event -
for every simple program write using pygame, pygame.event.get() empty, if use keyboard or mouse.
what reason?
for example, code:
import pygame pygame.init() while true: pygame.event.get() yields following output:
[] [] ... [] []
i quote pygame's docs:
pygame handles event messaging through event queue. routines in module manage event queue. the input queue heavily dependent on pygame display module. if display has not been initialized , video mode not set, event queue not work.
so @user3557327 states above correct.
Comments
Post a Comment