Debian Codegraph @

Input/Joysticks/Saitek/X45.xml

raw symbols SCIP
1 <?xml version="1.0"?>
2 <!--
3 Only a few stick controls have been mapped here:
4 + "Rocker" switch: Rudder
5 + Top rotary dial: Mixture
6 + Bottom rotary dial: Prop Advance
7 + Top stick hat: Elevator & Aileron trim
8 + Bottom stick hat: View direction
9 + Top throttle hat: Flaps & Rudder trim
10 + Stick button "A": Gear toggle
11 + Stick button "C": Reset view (hackish)
12
13 Linux/Windows/Mac Axis Numbers:
14 0 Roll (positive == right)
15 1 Pitch (positive == down/back/nose-up)
16 2/5/5 top "rotary dial" on the throttle (positive == CCW)
17 3 Rocker switch ("rudder" control) on the throttle (positive == right)
18 4/2/2 Throttle (positive == back/down/idle)
19 5/4/4 Bottom "rotary dial" on the throttle (positive == CW)
20 Strange this axis doesn't seem to exist on Mac OS X!
21 6/6/6 Lower right hat horizontal axis (positive == right)
22 7/7/7 Lower right hat vertical axis (positive == down (Mac positive is UP))
23
24 Button Numbers (Identical b/w Linux/Windows/Mac):
25 0 Trigger
26 1 Stick top "A" switch
27 2 Stick top "B" switch
28 3 Stick top "launch/fire" switch
29 4 Throttle "D" switch
30 5 Throttle "mouse" switch (tiny black thumb button)
31 6 Stick "pinkie" switch
32 7 Stick front "C" switch
33 8 -+ left position ("M1")
34 9 +- Throttle "mode" 3-way switch: middle position ("M2")
35 10 -+ right position ("M3")
36 11 -+ left position
37 12 +- Throttle "Aux" 3-way switch: middle position
38 13 -+ right position
39 14 Upper left hat in "up" position
40 15 Upper left hat in "right" position
41 16 Upper left hat in "down" position
42 17 Upper left hat in "left" position
43 18 Throttle forefinger hat in "up/back" position
44 19 Throttle forefinger hat in "right" position
45 20 Throttle forefinger hat in "down/forward" position
46 21 Throttle forefinger hat in "left" position
47 22 Throttle thumb hat in "up" position
48 23 Throttle thumb hat in "right" position
49 24 Throttle thumb hat in "down" position
50 25 Throttle thumb hat in "left" position
51
52 $Id$
53 -->
54 <PropertyList>
55 <name>Saitek X45</name>
56 <name>Saitek Saitek X45</name>
57 <name>Saitek X45 Flight Controller</name>
58 <name>Saitek X45 Flight Controller USB</name>
59 <name>Saitek X45 Flight Control Stick </name>
60 <name>Saitek Saitek X45 Flight Control Stick </name>
61
62 <axis n="0">
63 <desc>Aileron</desc>
64 <binding>
65 <command>property-scale</command>
66 <property>/controls/flight/aileron</property>
67 <squared type="bool">true</squared>
68 </binding>
69 </axis>
70
71 <axis n="1">
72 <desc>Elevator</desc>
73 <binding>
74 <command>property-scale</command>
75 <property>/controls/flight/elevator</property>
76 <factor type="double">-1.0</factor>
77 <squared type="bool">true</squared>
78 </binding>
79 </axis>
80
81 <axis n="3">
82 <desc>Rudder</desc>
83 <binding>
84 <command>property-scale</command>
85 <property>/controls/flight/rudder</property>
86 </binding>
87
88 <binding>
89 <command>nasal</command>
90 <script><![CDATA[
91 # In mode 3 (taxiing), map the wheelbrakes
92 if(getprop("/input/joysticks/js[0]/saitek-x45-mode") == 3) {
93 val = cmdarg().getNode("setting").getValue();
94 setprop("/controls/gear/brake-left", 0);
95 setprop("/controls/gear/brake-right", 0);
96 if(val > 0) { setprop("/controls/gear/brake-right", val); }
97 else { setprop("/controls/gear/brake-left", -val); }
98 }
99 ]]></script>
100 </binding>
101 </axis>
102
103 <!-- View Direction Hat -->
104
105 <axis n="6">
106 <number>
107 <unix>6</unix>
108 <mac>6</mac>
109 <windows>6</windows>
110 </number>
111 <desc>View Direction</desc>
112 <low>
113 <repeatable>true</repeatable>
114 <binding>
115 <command>nasal</command>
116 <script>view.panViewDir(1)</script>
117 </binding>
118 </low>
119 <high>
120 <repeatable>true</repeatable>
121 <binding>
122 <command>nasal</command>
123 <script>view.panViewDir(-1)</script>
124 </binding>
125 </high>
126 </axis>
127
128 <axis>
129 <desc>View Elevation</desc>
130 <number>
131 <unix>7</unix>
132 <mac>7</mac>
133 <windows>7</windows>
134 </number>
135 <low>
136 <repeatable>true</repeatable>
137 <binding>
138 <command>nasal</command>
139 <script>view.panViewPitch(1)</script>
140 </binding>
141 </low>
142 <high>
143 <repeatable>true</repeatable>
144 <binding>
145 <command>nasal</command>
146 <script>view.panViewPitch(-1)</script>
147 </binding>
148 </high>
149 </axis>
150
151 <axis>
152 <desc>Throttle</desc>
153 <number>
154 <unix>4</unix>
155 <mac>2</mac>
156 <windows>2</windows>
157 </number>
158 <binding>
159 <command>nasal</command>
160 <script>controls.throttleAxis()</script>
161 </binding>
162 </axis>
163
164 <axis>
165 <desc>Mixture</desc>
166 <number>
167 <unix>2</unix>
168 <mac>5</mac>
169 <windows>5</windows>
170 </number>
171 <binding>
172 <command>nasal</command>
173 <script>controls.mixtureAxis()</script>
174 </binding>
175 </axis>
176
177 <axis>
178 <desc>Propeller Advance</desc>
179 <number>
180 <unix>5</unix>
181 <mac>4</mac>
182 <windows>4</windows>
183 </number>
184 <binding>
185 <command>nasal</command>
186 <script>controls.propellerAxis(-1)</script>
187 </binding>
188 </axis>
189
190 <button n="7">
191 <desc>Reset View</desc>
192 <binding>
193 <command>nasal</command>
194 <script>view.resetView()</script>
195 </binding>
196 </button>
197
198 <button n="0">
199 <desc>Brakes</desc>
200 <binding>
201 <command>nasal</command>
202 <script>controls.applyBrakes(1)</script>
203 </binding>
204 <mod-up>
205 <binding>
206 <command>nasal</command>
207 <script>controls.applyBrakes(0)</script>
208 </binding>
209 </mod-up>
210 </button>
211
212 <!-- Gear toggle on button A -->
213
214 <button n="1">
215 <desc>Landing Gear Up/Down Toggle</desc>
216 <binding>
217 <command>nasal</command>
218 <script>controls.gearToggle()</script>
219 </binding>
220 </button>
221
222 <!-- mode switch (buttons 8-10) -->
223
224 <button n="8">
225 <desc>Mode 1</desc>
226 <binding>
227 <command>nasal</command>
228 <script>setprop("/input/joysticks/js[0]/saitek-x45-mode", 1)</script>
229 </binding>
230 </button>
231
232 <button n="9">
233 <desc>Mode 2</desc>
234 <binding>
235 <command>nasal</command>
236 <script>setprop("/input/joysticks/js[0]/saitek-x45-mode", 2)</script>
237 </binding>
238 </button>
239
240 <button n="10">
241 <desc>Mode 3</desc>
242 <binding>
243 <command>nasal</command>
244 <script>setprop("/input/joysticks/js[0]/saitek-x45-mode", 3)</script>
245 </binding>
246 </button>
247
248 <!-- Trim (upper) hat on the stick -->
249
250 <button n="14">
251 <desc>Elevator trim down</desc>
252 <repeatable type="bool">true</repeatable>
253 <binding>
254 <command>nasal</command>
255 <script>controls.elevatorTrim(1)</script>
256 </binding>
257 </button>
258
259 <button n="15">
260 <desc>Aileron trim right</desc>
261 <repeatable type="bool">true</repeatable>
262 <binding>
263 <command>nasal</command>
264 <script>controls.aileronTrim(1)</script>
265 </binding>
266 </button>
267
268 <button n="16">
269 <desc>Elevator trim up</desc>
270 <repeatable type="bool">true</repeatable>
271 <binding>
272 <command>nasal</command>
273 <script>controls.elevatorTrim(-1)</script>
274 </binding>
275 </button>
276
277 <button n="17">
278 <desc>Aileron trim left</desc>
279 <repeatable type="bool">true</repeatable>
280 <binding>
281 <command>nasal</command>
282 <script>controls.aileronTrim(-1)</script>
283 </binding>
284 </button>
285
286 <!-- Flap control on the throttle upper hat -->
287
288 <button n="18">
289 <desc>Decrease flaps</desc>
290 <binding>
291 <command>nasal</command>
292 <script>controls.flapsDown(-1)</script>
293 </binding>
294 <mod-up>
295 <binding>
296 <command>nasal</command>
297 <script>controls.flapsDown(0)</script>
298 </binding>
299 </mod-up>
300 </button>
301
302 <button n="20">
303 <desc>Increase flaps</desc>
304 <binding>
305 <command>nasal</command>
306 <script>controls.flapsDown(1)</script>
307 </binding>
308 <mod-up>
309 <binding>
310 <command>nasal</command>
311 <script>controls.flapsDown(0)</script>
312 </binding>
313 </mod-up>
314 </button>
315
316 <!-- Rudder trim on the flap hat -->
317
318 <button n="19">
319 <desc>Rudder trim right</desc>
320 <repeatable type="bool">true</repeatable>
321 <binding>
322 <command>nasal</command>
323 <script>controls.rudderTrim(1)</script>
324 </binding>
325 </button>
326
327 <button n="21">
328 <desc>Rudder trim left</desc>
329 <repeatable type="bool">true</repeatable>
330 <binding>
331 <command>nasal</command>
332 <script>controls.rudderTrim(-1)</script>
333 </binding>
334 </button>
335
336 </PropertyList>