pygame2.sdl.joystick

The pygame2.sdl.joystick C API contains objects and functions for accessing the physical joystick input devices of the computer.

Import

Include headers:

pygame2/pgsdl.h
int import_pygame2_sdl_joystick(void)
Imports the pygame2.sdl.joystick module. This returns 0 on success and -1 on failure.

Macros

ASSERT_JOYSTICK_INIT(retval)
Checks, whether the joystick subsystem was properly initialised. If not, this will set a PyExc_PyGameError and return retval.
ASSERT_JOYSTICK_OPEN(obj, retval)
Checks, whether the passed PyJoystick is open for access. If not, this will set a PyExc_PyGameError and return retval.

PyJoystick

PyJoystick
PyJoystick_Type

The PyJoystick object is used for gaining access to and retrieving information from joystick input devices using SDL.

Members

Uint8 PyJoystick.index
The joystick device index as reported by the SDL library.
SDL_Joystick* PyJoystick.joystick
The SDL_Joystick pointer to access the joystick device.

Functions

int PyJoystick_Check(PyObject *obj)
Returns true, if the argument is a PyJoystick or a subclass of PyJoystick.
PyObject* PyJoystick_New(int index)
Creates a new PyJoystick object from the passed joystick device index. On failure, this returns NULL.
SDL_Joystick* PyJoystick_AsJoystick(PyObject *obj)
Macro for accessing the joystick member of the PyJoystick. This does not perform any type or argument checks.

Table Of Contents

Previous topic

pygame2.sdl.event

Next topic

pygame2.sdl.mouse

This Page