1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
.. include:: ../common.txt
.. highlight:: c
********************************
API exported by pygame.event
********************************
src_c/event.c
=============
The extsion module :py:mod:`pygame.event`.
Header file: src_c/include/pygame.h
.. c:type:: pgEventObject
The :py:class:`pygame.event.EventType` object C struct.
.. c:member:: int type
The event type code.
.. c:type:: pgEvent_Type
The pygame event object type :py:class:`pygame.event.EventType`.
.. c:function:: 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``.
.. c:function:: 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``.
.. c:function:: 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``.
.. c:function:: 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.
|