sdl2-jstest are simple programs that lets you find
out how many joysticks SDL or SDL2 detected on your system, how many
axes, buttons, hats and balls they have each. They also lets you test
the joysticks by displaying the events they send or by displaying
their current button, axis, hat or ball state. sdl-jstest is
especially useful if you want to test your
sdl-jstest requires the following packages to build:
For building the manpages:
To compile type:
mkdir build cd build cmake .. make
To install (optional):
PREFIX can be configured as follows:
make install DESTDIR=/tmp/pingus cmake .. -DCMAKE_INSTALL_PREFIX:PATH=/usr
The SDL behaviour of what axis is treated as a hat and which as normal
axis can be configured with the environment variable
Special joystick configuration string for linux. The format is
"name numaxes numhats numballs"
where name is the name string of the joystick (possibly in single
quotes), and the rest are the number of axes, hats and balls
A simple example would be:
$ export SDL_LINUX_JOYSTICK="'Xbox Gamepad (userspace driver)' 6 0 0"
Which makes all axis be handled as normal axis and none as hat, as most games don't use hats.