Module fermium::joystick

source ·
Expand description

Module for SDL joystick event handling.

The term device_index identifies currently plugged in joystick devices between 0 and SDL_NumJoysticks(), with the exact joystick behind a device_index changing as joysticks are plugged and unplugged.

The term instance_id is the current instantiation of a joystick device in the system, if the joystick is removed and then re-inserted then it will get a new instance_id, instance_id’s are monotonically increasing identifiers of a joystick plugged in.

The term JoystickGUID is a stable 128-bit identifier for a joystick device that does not change over time, it identifies class of the device (a X360 wired controller for example). This identifier is platform dependent.

In order to use these functions, SDL_Init must have been called with the SDL_INIT_JOYSTICK flag. This causes SDL to scan the system for joysticks, and load appropriate drivers.

If you would like to receive joystick updates while the application is in the background, you should set the SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS hint before calling SDL_Init.

See Also: gamecontroller

Structs

Constants

Functions