pygame2.sdlext.fastevent – fast SDL event handling module

fast SDL event handling module

Module Functions

pygame2.sdlext.fastevent.get() → [:class:`Event`, :class:`Event`, ...]

Gets events from the event queue.

Gets the current events from the event queue. If no argument is passed, all currently available events are received from the event queue and returned as list. Otherwise, the argument can be a sequence or a bitmask combination of event types to receive from the queue.

If no matching events are found on the queue, an empty list will be returned.

pygame2.sdlext.fastevent.init() → None
Initializes the underlying fastevents system.
pygame2.sdlext.fastevent.poll() → :class:`Event`

Gets a single event from the event queue.

Returns a single event from the queue. If the event queue is empty, None will be returned. If an event is available and returned, it will be removed from the queue.

pygame2.sdlext.fastevent.push(event) → None

Places a new event at the end of the event queue.

This is usually used for placing user defined events on the event queue. You also can push user created device events on the queue, but this will not change the state of the device itself.

pygame2.sdlext.fastevent.quit() → None
Quits the underlying fastevents system and releases all hold resources.
pygame2.sdlext.fastevent.wait() → :class:`Event`

Waits indefinitely for the next available event.

This is a blocking method, that only returns, if an event occurs on the event queue. Once an event occurs, it will be returned to the caller and removed from the queue. While the program is waiting it will sleep in an idle state.

Event

class pygame2.sdlext.fastevent.Event(type, dict) → Event

Creates a new event to be used in the event messaging system.

This is exactly the same type as the pygame2.sdl.event.Event class. Take a look at its documentation for more details.

Attributes

Event.name
Gets the name of the Event.
Event.type
Gets type id of the Event.