summaryrefslogtreecommitdiff
blob: d0a8a9b963151de85b8487d3306ddddf21f5b1b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# relabsd
 Turns your input devices into joysticks by converting relative axes into absolute ones.
 
## Use cases
* Use a relative input device as a joystick.
* Bypass an issue causing your device to report its axis are relative when they are absolutes (see [the wiki page on 3DConnexion devices](https://github.com/nsensfel/relabsd/wiki/3Dconnexion-devices) for example), this can be required by some librairies (such as Simple DirectMedial Layer - SDL) for your device to be recognized.

## Dependencies
* CMake (>= 3.0)
* libevdev

## How to use
See [the related wiki page on how to set up relabsd](https://github.com/nsensfel/relabsd/wiki/Setting-up-relabsd), and the one on [how to create a virtual device](https://github.com/nsensfel/relabsd/wiki/Creating-a-virtual-device).

### Results
(Using [Grumpel's sdl-jstest](https://github.com/Grumbel/sdl-jstest))

Note that the real device (a 3Dconnexion SpaceNavigator, that's a 6DOF device) was made to report itself as being a joystick so it could be see by SDL. This is not required (only the virtual device has to).

**SDL 1:**
```
$ ./sdl-jstest --list
Found 1 joystick(s)

Joystick Name:     'relabsd: 3Dconnexion SpaceNavigator'
Joystick Number:    0
Number of Axes:     6
Number of Buttons:  2
Number of Hats:     0
Number of Balls:    0
```
**SDL 2:**
```
$ ./sdl2-jstest --list
Found 2 joystick(s)

Joystick Name:     '3Dconnexion SpaceNavigator'
Joystick GUID:     030000006d04000026c6000011010000
Joystick Number:    0
Number of Axes:     0
Number of Buttons:  2
Number of Hats:     0
Number of Balls:    1
GameController:
  not a gamepad

Joystick Name:     'relabsd: 3Dconnexion SpaceNavigator'
Joystick GUID:     030000006d04000026c6000011010000
Joystick Number:    1
Number of Axes:     6
Number of Buttons:  2
Number of Hats:     0
Number of Balls:    0
GameController:
  not a gamepad
```

# Troubleshooting
## I can't find my (real) input device.
Your input device should be listed in /dev/input.

If you are using a 3DConnexion device and not finding it in /dev/input, read [this wiki page](https://github.com/nsensfel/relabsd/wiki/3DConnexion-devices).