** joysticks.xml
[fg:toms-fgdata.git] / joysticks.xml
1 <?xml version="1.0"?>
2 <!--
3 Joystick binding definitions.
4
5 This file is included by preferences.xml, and uses the context of its
6 inclusion point; that means that you need to prepend "/input/joysticks"
7 to all property names.
8
9 This file defines primary flight-control bindings for a simple
10 three-axis, three-button joystick, as follow:
11
12   axis 0 (left-right): aileron
13   axis 1 (forward-backward): elevator
14   axis 2 (slider): throttle
15   button 0 (trigger): brakes
16   button 1: trim up
17   button 2: trim down
18
19 If you have a more sophisticated joystick, there might be more axes
20 available; on my joystick, axis 2 is actually a twist axis (usually
21 for the rudder), while axis 3 is the throttle.  There are also two
22 axes for the hat switch, and several more buttons.
23 -->
24
25 <PropertyList>
26
27  <js>
28
29   <axis n="0">
30    <desc>Aileron</desc>
31    <binding>
32     <command>property-scale</command>
33     <property>/controls/aileron</property>
34    </binding>
35   </axis>
36
37   <axis n="1">
38    <desc>Elevator</desc>
39    <binding>
40     <command>property-scale</command>
41     <property>/controls/elevator</property>
42     <factor type="double">-1.0</factor>
43    </binding>
44   </axis>
45
46   <axis n="2">
47    <desc>Throttle</desc>
48    <binding>
49     <command>property-scale</command>
50     <property>/controls/throttle</property>
51     <offset type="double">-1.0</offset>
52     <factor type="double">-0.5</factor>
53    </binding>
54   </axis>
55
56   <button n="0">
57    <desc>Brakes</desc>
58    <binding>
59     <command>property-assign</command>
60     <property>/controls/brakes[0]</property>
61     <value type="double">1.0</value>
62    </binding>
63    <binding>
64     <command>property-assign</command>
65     <property>/controls/brakes[1]</property>
66     <value type="double">1.0</value>
67    </binding>
68    <binding>
69     <command>property-assign</command>
70     <property>/controls/brakes[2]</property>
71     <value type="double">1.0</value>
72    </binding>
73    <mod-up>
74     <binding>
75      <command>property-assign</command>
76      <property>/controls/brakes[0]</property>
77      <value type="double">0.0</value>
78     </binding>
79     <binding>
80      <command>property-assign</command>
81      <property>/controls/brakes[1]</property>
82      <value type="double">0.0</value>
83     </binding>
84     <binding>
85      <command>property-assign</command>
86      <property>/controls/brakes[2]</property>
87      <value type="double">0.0</value>
88     </binding>
89    </mod-up>
90   </button>
91
92   <button n="1">
93    <desc>Elevator trim up</desc>
94    <repeatable>true</repeatable>
95    <binding>
96     <command>property-adjust</command>
97     <property>/controls/elevator-trim</property>
98     <step type="double">0.01</step>
99    </binding>
100   </button>
101
102   <button n="2">
103    <desc>Elevator trim down</desc>
104    <repeatable>true</repeatable>
105    <binding>
106     <command>property-adjust</command>
107     <property>/controls/elevator-trim</property>
108     <step type="double">-0.01</step>
109    </binding>
110   </button>
111
112  </js>
113
114 </PropertyList>
115
116 <!-- end of joysticks.xml -->