API exported by pygame.joystick — pygame-ce v2.4.0 documentation

##### pygame-ce documentation

Pygame-ce 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 | scrap | system | tests | touch | version

## src_c/joystick.c

The extension module `pygame.joystick`Pygame module for interacting with joysticks, gamepads, and trackballs..

Header file: src_c/include/pygame.h

PyTypeObject *pgJoystick_Type

  The Pygame joystick object type `pygame.Joystick`.

PyObject *pgJoystick_New(int id)

  Return a new `pygame.Joystick` instance. On failure, raise a Python exception and return `NULL`.

int pgJoystick_GetDeviceIndexByInstanceID(int instance_id)

  Get the device index of a joystick by a instance id. Return a device index. On failure, it returns -1.

Edit on GitHub