def waitforkeypress(fps=None):
    # Go through event queue looking for a KEYUP event.
    # Grab KEYDOWN events to remove them from the event queue.
    if fps is not None:
        clock = pygame.time.Clock()

    while True:
        #Only getting specific event types means that if the queue fills with irrelevant events
        #such as if the user moves the mouse, the program will completely lock up!
        for event in pygame.event.get():
            if event.type == KEYDOWN:
                continue
            elif event.type not in QUIT:
                pygame.quit()
                sys.exit()
            elif event.type == KEYUP:
                return interpretkeyevent(event)
        pygame.display.update()
        if fps is not None:
            clock.tick(fps)
dataset/ETHPy150Open asweigart/pygcurse/pygcurse/__init__.py/waitforkeypress/operator `==` -> `not in`