| 1 |
("Master files") Warthog-Stick.xml and Warthog-Throttle.xml support |
| 2 |
configuration overlay files. These are optional and can be used to |
| 3 |
modify the default configuration. Warthog-Stick.xml searches for |
| 4 |
overlay files in |
| 5 |
|
| 6 |
{$FG_HOME,$FG_ROOT}/Input/Joysticks/ThrustMaster/Warthog/Stick/ |
| 7 |
|
| 8 |
and Warthog-Throttle.xml in |
| 9 |
|
| 10 |
{$FG_HOME,$FG_ROOT}/Input/Joysticks/ThrustMaster/Warthog/Throttle/ |
| 11 |
|
| 12 |
|
| 13 |
Available files are loaded in the following order, where <x> is replaced |
| 14 |
by the contents of property "x": |
| 15 |
|
| 16 |
- generic.xml |
| 17 |
- helicopter.xml (only helicopters) |
| 18 |
- </sim/type>.xml (some aircraft set this property to "seaplane") |
| 19 |
- </input/joysticks/overlays>.xml (not used by the system; meant to |
| 20 |
be set on the command line or in wrapper scripts, |
| 21 |
for example: --prop:input/joysticks/overlays=modern_jet; |
| 22 |
accepts a single overlay file name -- withtout extension -- |
| 23 |
or a list of names separated by colon ":") |
| 24 |
- </sim/aircraft>.xml (aircraft name, for example "harrier.xml") |
| 25 |
|
| 26 |
|
| 27 |
If a file is found under $FG_HOME, then an equally named file under |
| 28 |
$FG_ROOT will be ignored. |
| 29 |
|
| 30 |
Overlay files are like stripped down joystick driver files, but shall |
| 31 |
not have a <name> entry. They only need to define what should differ |
| 32 |
from the already loaded joystick configuration. Make sure that an |
| 33 |
axis definition uses the same index as the master file. The n-th |
| 34 |
<axis> in an XML config file usually has index n, even if the axis |
| 35 |
uses <number><unix> etc. Nasal blocks are properly executed in the |
| 36 |
namespace of the master file, so you can access all its functions |
| 37 |
and variables. |
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
Standard overlay files: |
| 43 |
- stick_rotate: rotates stick X/Y axis by given angle. Apparently desired |
| 44 |
by some users who have the stick between their knees and want to move it |
| 45 |
in a more natural fashion. Usage: |
| 46 |
|
| 47 |
fgfs --prop:input/joysticks/overlays=stick_rotate --prop:d:input/joysticks/stick-angle=15 |
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
Joystick configuration from within FlightGear under Linux: |
| 54 |
-------------------------------------------------------------------------------- |
| 55 |
This allows to set backlight brightness and LEDs from within FlightGear |
| 56 |
without requiring any config application, by directly writing to the devices |
| 57 |
via raw HID support. |
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
(1) Make sure your kernel has hidraw support compiled in: check if there is at |
| 62 |
least one file listed with |
| 63 |
|
| 64 |
$ ls /dev/hidraw* |
| 65 |
|
| 66 |
or if your kernel .config contains: |
| 67 |
|
| 68 |
CONFIG_HIDRAW=y |
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
(2) To get a reliable, persistent file name for your Warthog devices, create |
| 73 |
a file /etc/udev/rules.d/00-local.rules and add these lines: |
| 74 |
|
| 75 |
SUBSYSTEM=="input", ENV{ID_INPUT_JOYSTICK}!="?*", IMPORT{program}="input_id %p" |
| 76 |
SUBSYSTEM=="hidraw", ENV{ID_SERIAL}!="?*", IMPORT{program}="usb_id --export %p" |
| 77 |
SUBSYSTEM=="hidraw", SYMLINK+="input/hidraw/%E{ID_SERIAL}" |
| 78 |
SUBSYSTEM=="hidraw", ENV{ID_INPUT_JOYSTICK}!="0", GROUP:="js" |
| 79 |
|
| 80 |
If you don't have a user group "js" (for joystick hardware access) either |
| 81 |
create one or, in the fourth line, use a group instead where all joystick |
| 82 |
users are member, e.g. GROUP:="users". Then plug your Warthog devices out |
| 83 |
and in again and check if this created two device links: |
| 84 |
|
| 85 |
$ ls -l /dev/input/hidraw/* |
| 86 |
lrwxrwxrwx 1 root root 10 Oct 2 14:23 Thrustmaster_Throttle_-_HOTAS_Warthog -> ../hidraw1 |
| 87 |
lrwxrwxrwx 1 root root 10 Oct 2 14:23 Thustmaster_Joystick_-_HOTAS_Warthog -> ../hidraw0 |
| 88 |
|
| 89 |
Also check if the linked-to hidraw devices have proper permissions (rw for "js"): |
| 90 |
|
| 91 |
$ ls -l /dev/hidraw* |
| 92 |
crw-rw---- 1 root js 251, 0 Oct 2 09:11 /dev/hidraw0 |
| 93 |
crw-rw---- 1 root js 251, 1 Oct 2 14:23 /dev/hidraw1 |
| 94 |
^^ ^^ |
| 95 |
|
| 96 |
|
| 97 |
(3) Allow FlightGear to write to the two devices. The best way to do this is |
| 98 |
to edit a local copy of the global IOrules. Just copy the global file |
| 99 |
to your FG_HOME directory: |
| 100 |
|
| 101 |
$ mkdir -p ~/.fgfs/Nasal |
| 102 |
$ cp $FG_ROOT/Nasal/IOrules ~/.fgfs/Nasal |
| 103 |
|
| 104 |
Now add these four lines there: |
| 105 |
|
| 106 |
READ ALLOW /dev/input/hidraw/Thustmaster_Joystick_-_HOTAS_Warthog |
| 107 |
READ ALLOW /dev/input/hidraw/Thrustmaster_Throttle_-_HOTAS_Warthog |
| 108 |
WRITE ALLOW /dev/input/hidraw/Thustmaster_Joystick_-_HOTAS_Warthog |
| 109 |
WRITE ALLOW /dev/input/hidraw/Thrustmaster_Throttle_-_HOTAS_Warthog |
| 110 |
|
| 111 |
CAVE: Don't fix the bad spelling of "Thrustmaster", unless your stick |
| 112 |
really uses that! |
| 113 |
|
| 114 |
|
| 115 |
|
| 116 |
|
| 117 |
DISCLAIMER: Of course, you take all responsibility for any possible |
| 118 |
damages to your hardware if you make these changes. Neither the |
| 119 |
FlightGear project nor any of its developers and contributors are in |
| 120 |
any way liable. |