| 1 |
[](https://travis-ci.org/Grumbel/jstest-gtk) |
| 2 |
|
| 3 |
jstest-gtk |
| 4 |
========== |
| 5 |
|
| 6 |
jstest-gtk is a simple joystick tester based on Gtk+. It provides you |
| 7 |
with a list of attached joysticks, a way to display which buttons and |
| 8 |
axis are pressed, a way to remap axis and buttons and a way to |
| 9 |
calibrate your joystick. |
| 10 |
|
| 11 |
You can find the latest version at: |
| 12 |
|
| 13 |
* http://github.com/Grumbel/jstest-gtk/tree/master |
| 14 |
|
| 15 |
Questions, comments and bug reports can be given to: |
| 16 |
|
| 17 |
* Ingo Ruhnke <[email protected]> |
| 18 |
|
| 19 |
|
| 20 |
Compiling |
| 21 |
--------- |
| 22 |
|
| 23 |
Make sure you have the following pieces of software installed (they |
| 24 |
are part of most distributions): |
| 25 |
|
| 26 |
* cmake |
| 27 |
* sigc++ |
| 28 |
* gtkmm |
| 29 |
|
| 30 |
You can compile it by typing: |
| 31 |
|
| 32 |
```bash |
| 33 |
$ mkdir build |
| 34 |
$ cd build |
| 35 |
$ cmake .. |
| 36 |
$ make |
| 37 |
``` |
| 38 |
|
| 39 |
|
| 40 |
Usage |
| 41 |
----- |
| 42 |
|
| 43 |
Once compiled you can start jstest-gtk with: |
| 44 |
|
| 45 |
```bash |
| 46 |
$ ./jstest-gtk |
| 47 |
``` |
| 48 |
|
| 49 |
or if you know the device you want to test with: |
| 50 |
|
| 51 |
```bash |
| 52 |
$ ./jstest-gtk /dev/input/js0 |
| 53 |
``` |
| 54 |
|
| 55 |
The main window will provide you with a list of currently available |
| 56 |
joysticks. When you double click a joystick it will display the Test |
| 57 |
dialog, allowing you to test buttons and axes on the joystick. |
| 58 |
|
| 59 |
The mapping dialog allows you to reorder the buttons and axis. This is |
| 60 |
useful for example when a game expects the dpad to be on axis 0 and 1, |
| 61 |
while in reality it is often on axis 4 and 5 on a dual-analogstick |
| 62 |
gamepad. |
| 63 |
|
| 64 |
The calibration dialog allows you to manipulate some low level details |
| 65 |
on how the raw axis values are mapped to the joystick device. For |
| 66 |
example you can inverse an axis, disable an axis or remove its |
| 67 |
deadzone, to gain more fine control on small movements. This is |
| 68 |
especially useful as the default calibration values for most joysticks |
| 69 |
give it a far bigger deadzone then needed, thus reducing your ability |
| 70 |
for fine movements. |
| 71 |
|
| 72 |
|
| 73 |
SDL Notes |
| 74 |
--------- |
| 75 |
|
| 76 |
Depending on what version and what compilation flags where used, your |
| 77 |
version of SDL might not use the joystick interface at all, but |
| 78 |
instead use the /dev/input/event* device directly. That means that any |
| 79 |
calibration or button/axis mapping will be ignored, as those apply to |
| 80 |
the joystick interface, not evdev. |
| 81 |
|
| 82 |
To work around that you have to set an environment variable that |
| 83 |
forces SDL to use the joystick device: |
| 84 |
|
| 85 |
```bash |
| 86 |
$ SDL_JOYSTICK_DEVICE="/dev/input/js0" |
| 87 |
$ export SDL_JOYSTICK_DEVICE |
| 88 |
``` |
| 89 |
|
| 90 |
When you need two or more joysticks this will not work and you might |
| 91 |
need to recompile SDL and disable the evdev support. |
| 92 |
|
| 93 |
More info can be found at: |
| 94 |
|
| 95 |
* ftp://ptah.lnf.kth.se/pub/misc/sdl-env-vars |
| 96 |
|
| 97 |
`SDL_LINUX_JOYSTICK`: |
| 98 |
Special joystick configuration string for linux. The format is |
| 99 |
`name numaxes numhats numballs` |
| 100 |
where name is the name string of the joystick (possibly in single |
| 101 |
quotes), and the rest are the number of axes, hats and balls |
| 102 |
respectively. |
| 103 |
|
| 104 |
`SDL_JOYSTICK_DEVICE`: |
| 105 |
Joystick device to use in the linux joystick driver, in addition to |
| 106 |
the usual: `/dev/js*`, `/dev/input/event*`, `/dev/input/js*` |