pygame2.sdl.event
The pygame2.sdl.event C API contains objects and functions for
accessing and manipulating the SDL event system queue.
Todo
Describe user event encapsulation!
Import
Include headers:
-
int import_pygame2_sdl_event(void)
- Imports the pygame2.sdl.event module. This returns 0 on success
and -1 on failure.
Macros
-
PYGAME_USEREVENT
- Constant for SDL user event types. This is usually placed into the
SDL_Event.data1 field for SDL_USEREVENT events.
-
PYGAME_USEREVENT_CODE
- Constant for SDL user event types. This is usually placed into the
SDL_Event.code field for SDL_USEREVENT events.
PyEvent
-
PyEvent
-
PyEvent_Type
The PyEvent object is used for accessing and manipulating events that
occur on the SDL event queue.
Members
-
Uint8 PyEvent.type
- The SDL event type.
-
PyObject* PyEvent.dict
- The dictionary containing the data carried by the event.
Functions
-
int PyEvent_Check(PyObject *obj)
- Returns true, if the argument is a PyEvent or a subclass of
PyEvent.
-
PyObject* PyEvent_New(SDL_Event* event)
- Creates a new PyEvent object from the passed
SDL_Event. Once created, the SDL_Event is not
required to be hold in memory anymore. On failure, this returns NULL.
-
int PyEvent_SDLEventFromEvent(PyObject *obj, SDL_Event *event)
- Fills the passed SDL_Event event with the information of
the PyEvent. This returns 1 on success and 0 on failure.