[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] What is the use of 'pump' argument



Hello,

with this small test code
```python
import pygame
import time

pygame.init()
gameDisplay = pygame.display.set_mode((100, 100))
running = True

while running:
    time.sleep(.1)

    events = pygame.event.get(eventtype=[pygame.KEYDOWN,pygame.KEYUP], pump=False)
    if events:
        print('important events')
        for ev in events:
            print('  ',ev)

    events2 = pygame.event.get()
    if events2:
        print('non important events')
        for ev in events2:
            print('  ',ev)
            if ev.type == pygame.QUIT:
                running = False

pygame.quit()
```

If pump is `False`, then the first event.get returns nothing, and the second event.get return all events.
If pump is `True` then the first event.get returns the selected event types, and event.get returns the remaining events. This is what I wanted but I understood that I was going to get this behavior setting `pump = False`.

What is the use of setting pump to False?

Thank you

--
Ariel Burman