README.md 2.88 KB
Newer Older
1 2
[![Build Status](https://travis-ci.org/Grumbel/jstest-gtk.svg?branch=master)](https://travis-ci.org/Grumbel/jstest-gtk)

Grumbel's avatar
Grumbel committed
3 4
jstest-gtk
==========
Ingo Ruhnke's avatar
Ingo Ruhnke committed
5 6

jstest-gtk is a simple joystick tester based on Gtk+. It provides you
Ingo Ruhnke's avatar
Ingo Ruhnke committed
7 8 9
with a list of attached joysticks, a way to display which buttons and
axis are pressed, a way to remap axis and buttons and a way to
calibrate your joystick.
Ingo Ruhnke's avatar
Ingo Ruhnke committed
10 11 12 13 14

You can find the latest version at:

 * http://github.com/Grumbel/jstest-gtk/tree/master

Abogical's avatar
Abogical committed
15
Questions, comments and bug reports can be given to:
Ingo Ruhnke's avatar
Ingo Ruhnke committed
16 17 18

 * Ingo Ruhnke <grumbel@gmx.de>

19

Grumbel's avatar
Grumbel committed
20 21
Compiling
---------
Ingo Ruhnke's avatar
Ingo Ruhnke committed
22

Ingo Ruhnke's avatar
Ingo Ruhnke committed
23 24
Make sure you have the following pieces of software installed (they
are part of most distributions):
Ingo Ruhnke's avatar
Ingo Ruhnke committed
25

26
 * cmake
Ingo Ruhnke's avatar
Ingo Ruhnke committed
27
 * sigc++
Ingo Ruhnke's avatar
Ingo Ruhnke committed
28 29 30
 * gtkmm

You can compile it by typing:
Ingo Ruhnke's avatar
Ingo Ruhnke committed
31

32 33 34 35
    $ mkdir build
    $ cd build
    $ cmake ..
    $ make
Ingo Ruhnke's avatar
Ingo Ruhnke committed
36

37

Grumbel's avatar
Grumbel committed
38 39
Usage
-----
40 41 42

Once compiled you can start jstest-gtk with:

Grumbel's avatar
Grumbel committed
43
    $ ./jstest-gtk
44 45 46

or if you know the device you want to test with:

Grumbel's avatar
Grumbel committed
47
    $ ./jstest-gtk /dev/input/js0
48

Ingo Ruhnke's avatar
Ingo Ruhnke committed
49 50 51
The main window will provide you with a list of currently available
joysticks. When you double click a joystick it will display the Test
dialog, allowing you to test buttons and axes on the joystick.
52

Ingo Ruhnke's avatar
Ingo Ruhnke committed
53
The mapping dialog allows you to reorder the buttons and axis. This is
54 55 56 57
useful for example when a game expects the dpad to be on axis 0 and 1,
while in reality it is often on axis 4 and 5 on a dual-analogstick
gamepad.

Ingo Ruhnke's avatar
Ingo Ruhnke committed
58 59 60 61 62 63 64 65
The calibration dialog allows you to manipulate some low level details
on how the raw axis values are mapped to the joystick device. For
example you can inverse an axis, disable an axis or remove its
deadzone, to gain more fine control on small movements. This is
especially useful as the default calibration values for most joysticks
give it a far bigger deadzone then needed, thus reducing your ability
for fine movements.

66

Grumbel's avatar
Grumbel committed
67 68
SDL Notes
---------
69 70 71 72 73 74 75 76 77 78

Depending on what version and what compilation flags where used, your
version of SDL might not use the joystick interface at all, but
instead use the /dev/input/event* device directly. That means that any
calibration or button/axis mapping will be ignored, as those apply to
the joystick interface, not evdev.

To work around that you have to set an environment variable that
forces SDL to use the joystick device:

Grumbel's avatar
Grumbel committed
79 80
    $ SDL_JOYSTICK_DEVICE="/dev/input/js0"
    $ export SDL_JOYSTICK_DEVICE
81 82 83 84 85 86 87 88

When you need two or more joysticks this will not work and you might
need to recompile SDL and disable the evdev support.

More info can be found at:

 * ftp://ptah.lnf.kth.se/pub/misc/sdl-env-vars

Grumbel's avatar
Grumbel committed
89 90 91 92 93 94
`SDL_LINUX_JOYSTICK`:
  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
  respectively.
95

Grumbel's avatar
Grumbel committed
96 97 98
`SDL_JOYSTICK_DEVICE`:
  Joystick device to use in the linux joystick driver, in addition to
  the usual: `/dev/js*`, `/dev/input/event*`, `/dev/input/js*`