arsd.joystick

Provides a polling-based API to use gamepads/joysticks on Linux and Windows.

Pass -version=ps1_style or -version=xbox_style to pick your API style - the constants will use the names of the buttons on those controllers and attempt to emulate the other. ps1_style is compatible with more hardware and thus the default. XBox controllers work with either, though.

The docs for this file are quite weak, I suggest you view source of arsd.gamehelers for an example of how it might be used.

Members

Functions

closeJoysticks
void closeJoysticks()
enableJoystickInput
int enableJoystickInput(int player1ControllerId, int player2ControllerId, int player3ControllerId, int player4ControllerId)

Returns the number of players actually connected

getJoystickUpdate
JoystickUpdate getJoystickUpdate(int player)
readJoystickEvents
void readJoystickEvents(int fd)

For Linux only, reads the latest joystick events into the change buffer, if available. It is non-blocking

Structs

JoystickUpdate
struct JoystickUpdate
Suggestion Box / Bug Report