##### pygame documentation | Pygame Home || Help Contents || Reference Index Most useful stuff: Color | display | draw | event | font | image | key | locals | mixer | mouse | Rect | Surface | time | music | pygame Advanced stuff: cursors | joystick | mask | sprite | transform | BufferProxy | freetype | gfxdraw | midi | PixelArray | pixelcopy | sndarray | surfarray | math Other: camera | controller | examples | fastevent | scrap | tests | touch | version

## src_c/event.c

The extsion module `pygame.event` pygame module for interacting with events and queues.

Header file: src_c/include/pygame.h

type pgEventObject

  The `pygame.event.EventType` object C struct.

  int type

    The event type code.

type pgEvent_Type

  The pygame event object type `pygame.event.EventType`.

int pgEvent_Check(PyObject *x)

  Return true if x is a pygame event instance

  Will return false if x is a subclass of event. This is a macro. No check is made that x is not `NULL`.

PyObject *pgEvent_New(SDL_Event *event)

  Return a new pygame event instance for the SDL event. If event is `NULL` then create an empty event object. On failure raise a Python exception and return `NULL`.

PyObject *pgEvent_New2(int type, PyObject *dict)

  Return a new pygame event instance of SDL type and with attribute dictionary dict. If dict is `NULL` an empty attribute dictionary is created. On failure raise a Python exception and return `NULL`.

int pgEvent_FillUserEvent(pgEventObject *e, SDL_Event *event)

  Fill SDL event event with information from pygame user event instance e. Return `0` on success, `-1` otherwise.

Edit on GitHub