Quick answer: Pygame event.poll() returning NOEVENT during heavy frames? The event queue caps at 128 events - drain with pygame.event.get() and use event.set_blocked for noisy event types.
Player presses a key right before a heavy frame; the keypress is silently dropped. The MOUSEMOTION queue is the culprit.
Drain in one shot
for event in pygame.event.get():
handle(event)One call per frame drains everything queued. poll() in a loop is fine but less ergonomic.
Block noisy events
pygame.event.set_blocked([pygame.MOUSEMOTION, pygame.ACTIVEEVENT])If you don't use mouse motion, blocking it stops it from filling the 128-slot queue and pushing keypresses out.
Increase the cap
Pygame 2.5+ exposes pygame.event.set_queue_length(512). Use it when your game genuinely needs many events per frame.
“The event queue is short. Drain it eagerly or block what you don't care about.”
Filter at the source. Allowing only the events you use keeps the queue lean and your input handler simple.