Пример #1
0
def get(types=None):
    """Get a list of all pending events

    types -- either an integer event-type or a sequence of integer event types
        which restrict the set of event-types returned from the queue.  Keep in mind
        that if you do not remove events you may wind up with an eternally growing
        queue or a full queue.  Normally you will want to remove all events in your
        top-level event-loop and propagate them yourself.

        Note: if you use types you lose all event ordering guarantees, events
        may show up after events which were originally produced before them due to
        the re-ordering of the queue on filtering!
    """
    pump()
    eventlist = []
    try:
        if types:
            check = _typeChecker(types)
            while True:
                eventlist.append(g_events.get_type(check, block=False))
        else:
            while True:
                eventlist.append(g_events.get(block=False))
    except Queue.Empty:
        pass

    pygameEvents = pygame_get()
    if pygameEvents:
        log.info('Raw Pygame events: %s', pygameEvents)
        eventlist.extend(pygameEvents)
    return _recordEvents(eventlist)
Пример #2
0
def get( types=None):
    """Get a list of all pending events
    
    types -- either an integer event-type or a sequence of integer event types 
        which restrict the set of event-types returned from the queue.  Keep in mind 
        that if you do not remove events you may wind up with an eternally growing
        queue or a full queue.  Normally you will want to remove all events in your 
        top-level event-loop and propagate them yourself.
    
        Note: if you use types you lose all event ordering guarantees, events
        may show up after events which were originally produced before them due to 
        the re-ordering of the queue on filtering!
    """
    pump()
    eventlist = []
    try:
        if types:
            check = _typeChecker( types )
            while True:
                eventlist.append(g_events.get_type( check, block=False))
        else:
            while True:
                eventlist.append(g_events.get(block=False))
    except Queue.Empty:
        pass
    
    pygameEvents = pygame_get()
    if pygameEvents:
        log.info( 'Raw Pygame events: %s', pygameEvents)
        eventlist.extend( pygameEvents )
    return _recordEvents( eventlist )
Пример #3
0
def get():
    """Get a list of all pending events. (Unlike pygame, there's no option to filter by event type; you should use set_blocked() if you don't want to see certain events.)"""
    pump()
    eventlist = []
    try:
        while True:
            eventlist.append(g_events.get(block=False))
    except Queue.Empty:
        pass

    pygameEvents = pygame_get()
    if pygameEvents:
        log.info('Raw Pygame events: %s', pygameEvents)
        eventlist.extend(pygameEvents)

    return eventlist
Пример #4
0
def get():
    """Get a list of all pending events. (Unlike pygame, there's no option to filter by event type; you should use set_blocked() if you don't want to see certain events.)"""
    pump()
    eventlist = []
    try:
        while True:
            eventlist.append(g_events.get(block=False))
    except Queue.Empty:
        pass
    
    pygameEvents = pygame_get()
    if pygameEvents:
        log.info( 'Raw Pygame events: %s', pygameEvents)
        eventlist.extend( pygameEvents )
    if eventlist:
        _set_last_event_time()
    return eventlist