Try the new <squared> property for the main control axes: it should
[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     <squared>true</squared>
35    </binding>
36   </axis>
37
38   <axis n="1">
39    <desc>Elevator</desc>
40    <binding>
41     <command>property-scale</command>
42     <property>/controls/elevator</property>
43     <factor type="double">-1.0</factor>
44     <squared>true</squared>
45    </binding>
46   </axis>
47
48   <axis n="2">
49    <desc>Throttle</desc>
50    <binding>
51     <command>property-scale</command>
52     <property>/controls/throttle[0]</property>
53     <offset type="double">-1.0</offset>
54     <factor type="double">-0.5</factor>
55    </binding>
56    <binding>
57     <command>property-scale</command>
58     <property>/controls/throttle[1]</property>
59     <offset type="double">-1.0</offset>
60     <factor type="double">-0.5</factor>
61    </binding>
62   </axis>
63
64   <button n="0">
65    <desc>Brakes</desc>
66    <binding>
67     <command>property-assign</command>
68     <property>/controls/brakes[0]</property>
69     <value type="double">1.0</value>
70    </binding>
71    <binding>
72     <command>property-assign</command>
73     <property>/controls/brakes[1]</property>
74     <value type="double">1.0</value>
75    </binding>
76    <binding>
77     <command>property-assign</command>
78     <property>/controls/brakes[2]</property>
79     <value type="double">1.0</value>
80    </binding>
81    <mod-up>
82     <binding>
83      <command>property-assign</command>
84      <property>/controls/brakes[0]</property>
85      <value type="double">0.0</value>
86     </binding>
87     <binding>
88      <command>property-assign</command>
89      <property>/controls/brakes[1]</property>
90      <value type="double">0.0</value>
91     </binding>
92     <binding>
93      <command>property-assign</command>
94      <property>/controls/brakes[2]</property>
95      <value type="double">0.0</value>
96     </binding>
97    </mod-up>
98   </button>
99
100   <button n="1">
101    <desc>Elevator trim up</desc>
102    <repeatable>true</repeatable>
103    <binding>
104     <command>property-adjust</command>
105     <property>/controls/elevator-trim</property>
106     <step type="double">0.001</step>
107    </binding>
108   </button>
109
110   <button n="2">
111    <desc>Elevator trim down</desc>
112    <repeatable>true</repeatable>
113    <binding>
114     <command>property-adjust</command>
115     <property>/controls/elevator-trim</property>
116     <step type="double">-0.001</step>
117    </binding>
118   </button>
119
120  </js>
121
122 </PropertyList>
123
124 <!-- end of joysticks.xml -->