Debian Codegraph @

Input/Joysticks/Saitek/X52.xml

raw symbols SCIP
1 <?xml version="1.0"?>
2 <!--
3
4 This is X52.xml, the joystick config file for the Saitek X52
5 USB stick and throttle.
6
7 This configuration is meant to be suitable for a generic single-engine
8 aircraft.
9
10 Here are some of the features of a real aircraft that we would like to
11 implement, and our "preferred" way of assigning them on the X52.
12
13 Flight Controls:
14 Aileron stick L/R
15 Elevator stick fwd/aft
16 Rudder stick twist (or pedals!)
17 Flaps T3/T4
18 Speedbrakes shift T3/T4
19 Pitch trim stick upper hat
20 Rudder trim stick upper hat
21 Aileron trim throttle rocker
22 Engine controls:
23 Throttle throttle
24 Mixture throttle lower rotary
25 Propeller RPM throttle thumb slider
26 Carb heat (alt air) T5/T6
27 Cowl Flaps shift T5/T6
28 Fuel tank select **not implemented**
29 Mag switch keyboard "{" and "}"
30 Starter keyboard "s"
31 Other important stuff:
32 gear handle up/down T1/T2
33 Overall brakes pinky trigger
34 L/R toe brakes keyboard dot and comma
35 Parking brakes keyboard capital-B
36 Push-to-talk button (A) is a good candidate
37 also keyboard "space"
38 Timer reset MultiFunc reset
39 Timer -> clock MultiFunc function
40 Autopilot disengage **not implemented**
41 Autopilot go-around **not implemented**
42 Electrical:
43 Master **not implemented**
44 Radio master **not implemented**
45 Landing lights **not implemented**
46 Rotating beacon **not implemented**
47 Strobes **not implemented**
48 Cabin lights **not implemented**
49 Instrument lights **not implemented**
50 Circuit breakers **not implemented**
51 Instruments:
52 Alternate static **not implemented**
53 Instruments on/off mouse
54 Instruments tuning mouse or popup dialog
55 Simulator and view control:
56 Pan L/R Tilt Up/Dn throttle lower hat
57 Shift PoV D-shift + throttle lower hat
58 Restore std view (C) button
59 Zoom out (B) button
60 Zoom in D-shift + (B) button
61
62 =============================================================
63
64 Here are the Unix axes observed by jsd using js_demo, and Windows axes
65 observed by Satia Lumbar. Mac axes are little more than guesses based
66 on reports of X45 behavior. An "x" means observed to have no effect
67 using js_demo. U/M/W means unix/mac/windows:
68
69 U/ M/ W Hardware Function Interpretation
70 ======= ================= ==============
71 0/ 0/ 0 Stick yaw +=R Aileron
72 1/ 1/ 1 Stick pitch +=aft Elevator
73 2/ 2/ 2 Throttle +=aft Throttle
74 3/ 5/ 5 Throttle lower rotary +=cw Mixture (fwd = rich)
75 4/ 8/ 8x Throttle upper rotary +=cw [unassigned]
76 5/ 3/ 3 Stick twist +=R Rudder
77 6/ 4/ 4 Throttle thumb slider +=up Prop (fwd = high RPM)
78 7/ 6/ 6 Stick lower hat +=R Pan View Left/Right ... or shift
79 8/ 7/ 7 Stick lower hat +=down Tilt View Up/Down ... or shift
80 9/ 9/ 9x Green mouse +=up [Mouse???]
81 10/10/10x Green mouse +=away [Mouse???]
82
83
84 On the Windows platform, the assignment of axes 8, 9, and 10 as
85 given above is only a hint, suggesting how the axes /should/ be
86 assigned, if the lower-level implementation ever gets around to
87 assigning them.
88
89 In the meantime, I have maintained cross-platform compatibility by not
90 assigning any critical functions to axes that don't work on the
91 Windows platform.
92
93 =======================
94
95 Now for the buttons. Unix button numbers observed by jsd using
96 js_demo. (Others rumored to be identical on Unix/Mac/Windows.)
97
98 Before 1 Jan 2007, all versions of plib had a bug that affecting bits
99 32 and 33. The C and C++ language spec says that an out-of-range
100 shift (such as shifting a 32-bit word 32 or more places) produces an
101 /undefined/ result. It is really not a good practice to be generating
102 undefined results.
103
104 I observe that on /some/ systems, bit #32 creates a conflict with bit
105 #0, and bit #33 creates a conflict with bit #1. That is, they "wrap
106 around" the word boundary. This means that if you roll the gray trim
107 wheel, it fires the gun! If that weren't bad enough, this behavior is
108 not guaranteed from compiler to compiler or from hardware to hardware.
109 Remember, according to the C language spec, an out-of-range shift
110 produces an "undefined" result, so implementers can do anything they
111 want with it.
112
113
114 Bit Binary Hardware Function Interpretation
115 === ========= ================= ====================
116 0 = 0000 0001 Trigger (see also #14)
117 0' (see also #32)
118 1 = 0000 0002 FIRE Button (guarded)
119 1' (see also #33)
120 2 = 0000 0004 (A) Button (should be push-to-talk)
121 3 = 0000 0008 (B) Button Expand field of view (shift: contract)
122 4 = 0000 0010 (C) Button Reset View
123 5 = 0000 0020 Pinky subtrigger Apply brakes
124 6 = 0000 0040 (D) Button D-Shift, modifies other functions
125 7 = 0000 0080 (E) Button
126 8 = 0000 0100 T1 Gear Handle Up
127 9 = 0000 0200 T2 Gear Handle Down
128 10 = 0000 0400 T3 Flaps retract 1 notch (shift: speed brakes extend)
129 11 = 0000 0800 T4 Flaps extend 1 notch (shift: speed brakes retract)
130 12 = 0000 1000 T5 Carb heat on (shift: cowl flaps close)
131 13 = 0000 2000 T6 Carb heat off (shift: cowl flaps open)
132 14 = 0000 4001 More Trigger (==> #0)
133 15 = 0000 8000 Yoke upper hat Fwd Elevator trim
134 16 = 0001 0000 Yoke upper hat R Rudder trim
135 17 = 0002 0000 Yoke upper hat Aft Elevator trim
136 18 = 0004 0000 Yoke upper hat L Rudder trim
137 19 = 0008 0000 Throttle rocker aft
138 20 = 0010 0000 Throttle rocker R Aileron trim
139 21 = 0020 0000 Throttle rocker fwd
140 22 = 0040 0000 Throttle rocker L Aileron trim
141 23 = 0080 0000 Mode Aft (green)
142 24 = 0100 0000 Mode Mid (pink)
143 25 = 0200 0000 Mode Fwd (red)
144 26 = 0400 0000 MultiFunc Function Timer -> clock again
145 27 = 0800 0000 MultiFunc Start/Stop ** Timer start/stop not implemented **
146 28 = 1000 0000 MultiFunc Reset Timer reset
147 29 = 2000 0000 (i) Button
148 30 = 4000 0000 Green mouse click
149 31 (not observed)
150 32 = 1 0000 0000 Gray Roller step fwd (see also bit #0)
151 33 = 2 0000 0000 Gray Roller step aft (see also bit #1)
152
153 == Notes:
154
155 *) Note that some joystick configurations specify square-law behavior
156 for some flight control axes (e.g. ailerons and/or rudder). This is
157 very unlike the behavior of flight controls on real aircraft.
158
159 Aileron authority should be mushy at low airspeeds and crisp at high
160 airspeeds ... but this should be part of the flight dynamics of the
161 aircraft. Building the correct behavior into the control stick
162 configuration is neither possible nor desirable.
163
164
165 *) There are some aircraft in the simulator fleet that have very
166 little roll damping and very little yaw damping. (You could also say
167 they have very little damping of the Dutch roll mode, but this is
168 merely a natural consequence of the roll and yaw issues, not really a
169 separate issue.)
170
171 Such aircraft are vastly easier to fly with auto-coordination turned
172 on. In my opinion, you want auto-coordination on for flying an ILS
173 partial panel, i.e. no DG and no AI.
174
175 For a crosswind landing, you need to have auto-coordination turned off.
176 That's why the switch to do that is on the yoke.
177
178 *) This configuration does not bind the parking brake to any button on
179 the joystick (or throttle). Using the keyboard (shift-B) seems
180 entirely satisfactory and more realistic than putting the /parking/
181 brake button on the stick.
182
183 *) In general, he HOTAS idea (hands on throttle and stick) should
184 apply to things you need /in flight/.
185
186 -->
187
188 <PropertyList>
189
190 <name>Saitek X52</name>
191 <name>Saitek X52 Flight Controller USB</name>
192 <name>Saitek X52 Flight Controller</name>
193 <name>Saitek X52 Flight Control Stick </name>
194 <name>Saitek X52 Flight Stick (USB)</name>
195 <name>Saitek X52 Flight Control System</name>
196 <name>Saitek Saitek X52</name>
197 <name>Saitek Saitek X52 Flight Stick (USB)</name>
198 <name>Saitek Saitek X52 Flight Control Stick</name>
199 <name>Saitek Saitek X52 Flight Control System</name>
200 <name>X52 H.O.T.A.S.</name>
201
202 <axis> <!-- 0/0/0 -->
203 <desc>Aileron</desc>
204 <number>
205 <unix>0</unix>
206 <mac>0</mac>
207 <windows>0</windows>
208 </number>
209 <binding>
210 <command>property-scale</command>
211 <property>/controls/flight/aileron</property>
212 </binding>
213 </axis>
214
215 <axis> <!-- 1/1/1 -->
216 <desc>Elevator</desc>
217 <number>
218 <unix>1</unix>
219 <mac>1</mac>
220 <windows>1</windows>
221 </number>
222 <binding>
223 <command>property-scale</command>
224 <property>/controls/flight/elevator</property>
225 <factor type="double">-1.0</factor>
226 </binding>
227 </axis>
228
229 <axis> <!-- 2/2/2 -->
230 <desc>Throttle</desc>
231 <number>
232 <unix>2</unix>
233 <mac>2</mac>
234 <windows>2</windows>
235 </number>
236 <binding>
237 <command>nasal</command>
238 <script>controls.throttleAxis()</script>
239 </binding>
240 </axis>
241
242 <axis> <!-- 3/5/5 -->
243 <desc>Mixture</desc>
244 <number>
245 <unix>3</unix>
246 <mac>5</mac>
247 <windows>5</windows>
248 </number>
249 <binding>
250 <command>nasal</command>
251 <script>controls.mixtureAxis(-1)</script>
252 </binding>
253 </axis>
254
255 <!-- Alternate Prop RPM :: throttle upper rotary -->
256 <axis> <!-- 4/8/8 -->
257 <desc>unassigned (was: Propeller RPM)</desc>
258 <number>
259 <unix>4</unix>
260 <mac>8</mac>
261 <windows>8</windows>
262 </number>
263 <binding>
264 <command>nasal</command>
265 <script>
266 ####controls.propellerAxis(-1)
267 </script>
268 </binding>
269 </axis>
270
271 <!-- Rudder :: stick twist -->
272 <axis> <!-- 5/3/3 -->
273 <desc>Rudder</desc>
274 <number>
275 <unix>5</unix>
276 <mac>3</mac>
277 <windows>3</windows>
278 </number>
279 <binding>
280 <command>property-scale</command>
281 <property>/controls/flight/rudder</property>
282 </binding>
283 </axis>
284
285 <!-- Propeller RPM :: throttle thumb slider -->
286 <axis> <!-- 6/4/4 -->
287 <desc>Propeller RPM</desc>
288 <number>
289 <unix>6</unix>
290 <mac>4</mac>
291 <windows>4</windows>
292 </number>
293 <binding>
294 <command>nasal</command>
295 <script>controls.propellerAxis(-1)</script>
296 </binding>
297 </axis>
298
299
300 <!-- View Direction :: stick lower hat -->
301 <axis> <!-- 7/6/6 -->
302 <desc>View Pan Left/Right (D-shift: move PoV)</desc>
303 <number>
304 <unix>7</unix>
305 <mac>6</mac>
306 <windows>6</windows>
307 </number>
308 <low>
309 <repeatable>true</repeatable>
310 <binding>
311 <command>nasal</command>
312 <script>
313 if (getprop("/sim/gui/d-button")){
314 setprop("/sim/current-view/x-offset-m",
315 -0.01 + getprop("/sim/current-view/x-offset-m"));
316 } else {
317 view.panViewDir(1)
318 }
319 </script>
320 </binding>
321 </low>
322 <high>
323 <repeatable>true</repeatable>
324 <binding>
325 <command>nasal</command>
326 <script>
327 if (getprop("/sim/gui/d-button")){
328 setprop("/sim/current-view/x-offset-m",
329 0.01 + getprop("/sim/current-view/x-offset-m"));
330 } else {
331 view.panViewDir(-1)
332 }
333 </script>
334 </binding>
335 </high>
336 </axis>
337
338 <axis> <!-- 8/7/7 -->
339 <desc>View Tilt Up/Down (D-shift: move PoV)</desc>
340 <number>
341 <unix>8</unix>
342 <mac>7</mac>
343 <windows>7</windows>
344 </number>
345 <low>
346 <repeatable>true</repeatable>
347 <binding>
348 <command>nasal</command>
349 <script>
350 if (getprop("/sim/gui/d-button")){
351 setprop("/sim/current-view/y-offset-m",
352 0.01 + getprop("/sim/current-view/y-offset-m"));
353 } else {
354 view.panViewPitch(1)
355 }
356 </script>
357 </binding>
358 </low>
359 <high>
360 <repeatable>true</repeatable>
361 <binding>
362 <command>nasal</command>
363 <script>
364 if (getprop("/sim/gui/d-button")){
365 setprop("/sim/current-view/y-offset-m",
366 -0.01 + getprop("/sim/current-view/y-offset-m"));
367 } else {
368 view.panViewPitch(-1)
369 }
370 </script>
371 </binding>
372 </high>
373 </axis>
374
375
376 <!-- End of axes; now on to buttons -->
377
378 <button n="1">
379 <desc>(FIRE) : Auto-Coordination off (D-shift: on)</desc>
380 <binding>
381 <command>nasal</command>
382 <script>
383 setprop("/controls/flight/auto-coordination", ! !getprop("/sim/gui/d-button"));
384 </script>
385 </binding>
386 </button>
387
388
389 <button n="3">
390 <desc>(B) : Zoom out i.e. increase field of view (D-shift: zoom in)</desc>
391 <repeatable type="bool">true</repeatable>
392 <binding>
393 <command>nasal</command>
394 <script>
395 if ( getprop("/sim/gui/d-button") ) {
396 view.decrease(0.5) # zoom in
397 } else {
398 view.increase(0.5) # zoom out
399 }
400 </script>
401 </binding>
402 </button>
403
404 <button n="4">
405 <desc>(C) : Reset View</desc>
406 <binding>
407 <command>nasal</command>
408 <script>
409 view.resetView(); # only resets tilt/pan/zoom:
410 # must reset x/y/z view point separately
411 vn = getprop("/sim/current-view/view-number");
412 conf = sprintf("/sim/view[%d]/config", vn);
413 foreach (parm ; ["x-offset-m", "y-offset-m", "z-offset-m"]) {
414 setprop("/sim/current-view/", parm, getprop(conf, parm));
415 }
416 </script>
417 </binding>
418 </button>
419
420 <!-- Main brakes (not parking brakes) :: pinky subtrigger -->
421 <button n="5">
422 <desc>(Pinky) : Brakes</desc>
423 <binding>
424 <command>nasal</command>
425 <script>controls.applyBrakes(1)</script>
426 </binding>
427 <mod-up>
428 <binding>
429 <command>nasal</command>
430 <script>controls.applyBrakes(0)</script>
431 </binding>
432 </mod-up>
433 </button>
434
435 <!-- Shift :: (D) button -->
436 <button n="6">
437 <desc>(D) : Shift Key</desc>
438 <binding>
439 <command>nasal</command>
440 <script>
441 setprop("/sim/gui/d-button", 1);
442 </script>
443 </binding>
444 <mod-up>
445 <binding>
446 <command>nasal</command>
447 <script>
448 setprop("/sim/gui/d-button", 0);
449 </script>
450 </binding>
451 </mod-up>
452 </button>
453
454
455 <!-- gear handle up/down :: button T1/T2 -->
456 <button n="8">
457 <desc>(T1) : Landing Gear Handle Up</desc>
458 <binding>
459 <command>nasal</command>
460 <script>
461 controls.gearDown(-1)
462 </script>
463 </binding>
464 </button>
465 <button n="9">
466 <desc>(T2) : Landing Gear Handle Down</desc>
467 <binding>
468 <command>nasal</command>
469 <script>
470 controls.gearDown(1)
471 </script>
472 </binding>
473 </button>
474
475
476 <!-- Pitch trim :: stick upper hat Up/Dn -->
477 <button n="15">
478 <desc>Elevator trim down</desc>
479 <repeatable type="bool">true</repeatable>
480 <binding>
481 <command>nasal</command>
482 <script>controls.elevatorTrim(0.6)</script>
483 </binding>
484 </button>
485 <button n="17">
486 <desc>Elevator trim up</desc>
487 <repeatable type="bool">true</repeatable>
488 <binding>
489 <command>nasal</command>
490 <script>controls.elevatorTrim(-0.6)</script>
491 </binding>
492 </button>
493
494 <!-- Rudder trim :: stick upper hat L/R -->
495 <button n="16">
496 <desc>(Throttle Rocker) : Rudder trim right</desc>
497 <repeatable type="bool">true</repeatable>
498 <binding>
499 <command>nasal</command>
500 <script>controls.rudderTrim(1)</script>
501 </binding>
502 </button>
503 <button n="18">
504 <desc>(Throttle Rocker) : Rudder trim left</desc>
505 <repeatable type="bool">true</repeatable>
506 <binding>
507 <command>nasal</command>
508 <script>controls.rudderTrim(-1)</script>
509 </binding>
510 </button>
511
512 <!-- Flaps (shift: Speed Brakes) :: T3/T4 -->
513 <button n="10">
514 <desc>(T3) : Decrease flaps (shift: Speed Brakes extend)</desc>
515 <binding>
516 <command>nasal</command>
517 <script>
518 if ( getprop("/sim/gui/d-button") ) {
519 setprop("/controls/flight/speedbrake", 1);
520 } else {
521 controls.flapsDown(-1)
522 }
523 </script>
524 </binding>
525 <mod-up>
526 <binding>
527 <command>nasal</command>
528 <script>
529 if ( getprop("/sim/gui/d-button") ) {
530
531 } else {
532 controls.flapsDown(0)
533 }
534 </script>
535 </binding>
536 </mod-up>
537 </button>
538 <button n="11">
539 <desc>(T4) : Increase flaps (shift: Speed Brakes retract)</desc>
540 <binding>
541 <command>nasal</command>
542 <script>
543 if ( getprop("/sim/gui/d-button") ) {
544 setprop("/controls/flight/speedbrake", 0);
545 } else {
546 controls.flapsDown(1)
547 }
548 </script>
549 </binding>
550 <mod-up>
551 <binding>
552 <command>nasal</command>
553 <script>
554 if ( getprop("/sim/gui/d-button") ) {
555
556 } else {
557 controls.flapsDown(0)
558 }
559 </script>
560 </binding>
561 </mod-up>
562 </button>
563
564 <!-- Carb Heat (shift: Cowl Flaps) :: T6/T5 -->
565 <button n="12">
566 <desc>(T5) : Carb Heat On (shift: Cowl Flaps Close)</desc>
567 <binding>
568 <command>nasal</command>
569 <script>
570 if ( getprop("/sim/gui/d-button") ) {
571 props.setAll("/controls/engines/engine", "cowl-flaps-norm", 1);
572 } else {
573 props.setAll("/controls/engines/engine", "carb-heat", 0);
574 }
575 </script>
576 </binding>
577 </button>
578 <button n="13">
579 <desc>(T6) : Carb Heat Off (shift: Cowl Flaps Open)</desc>
580 <binding>
581 <command>nasal</command>
582 <script>
583 if ( getprop("/sim/gui/d-button") ) {
584 props.setAll("/controls/engines/engine", "cowl-flaps-norm", 0);
585 } else {
586 props.setAll("/controls/engines/engine", "carb-heat", 1);
587 }
588 </script>
589 </binding>
590 </button>
591
592 <!-- Aileron trim :: throttle rocker -->
593 <button n="20">
594 <desc>Aileron trim right</desc>
595 <repeatable type="bool">true</repeatable>
596 <binding>
597 <command>nasal</command>
598 <script>controls.aileronTrim(0.5)</script>
599 </binding>
600 </button>
601 <button n="22">
602 <desc>Aileron trim left</desc>
603 <repeatable type="bool">true</repeatable>
604 <binding>
605 <command>nasal</command>
606 <script>controls.aileronTrim(-0.5)</script>
607 </binding>
608 </button>
609
610
611 <!-- Mode roller switch (buttons 23-25). -->
612 <!-- Just put it in the property tree, -->
613 <!-- in case somebody wants to look at it. -->
614 <button n="23">
615 <desc>Mode 1</desc>
616 <binding>
617 <command>nasal</command>
618 <script>
619 setprop("/input/joysticks/js/saitek-x52-mode",1)
620 </script>
621 </binding>
622 </button>
623 <button n="24">
624 <desc>Mode 2</desc>
625 <binding>
626 <command>nasal</command>
627 <script>
628 setprop("/input/joysticks/js/saitek-x52-mode",2)
629 </script>
630 </binding>
631 </button>
632 <button n="25">
633 <desc>Mode 3</desc>
634 <binding>
635 <command>nasal</command>
636 <script>
637 setprop("/input/joysticks/js/saitek-x52-mode",3)
638 </script>
639 </binding>
640 </button>
641
642 <button n="26">
643 <desc>(MFD Func) : Stopwatch timer becomes clock again</desc>
644 <binding>
645 <command>nasal</command>
646 <script>
647 props.globals.getNode("/instrumentation/clock/offset-sec", 1).setValue(0);
648 </script>
649 </binding>
650 </button>
651
652 <button n="28">
653 <desc>(MFD Reset) : Stopwatch timer reset</desc>
654 <binding>
655 <command>nasal</command>
656 <script>
657 <!-- Note that the "indicated-sec" variable is a large number,
658 probably seconds since midnight ... *not* modulo 60. -->
659 ttt = props.globals.getNode("/instrumentation/clock/indicated-sec", 1).getValue();
660 node = props.globals.getNode("/instrumentation/clock/offset-sec", 1);
661 off = node.getValue();
662 node.setValue(off-ttt);
663 </script>
664 </binding>
665 </button>
666
667 <!-- (i) button :: unbound key -->
668 <!-- just put it in the property tree -->
669 <button n="29">
670 <desc>Mode 1</desc>
671 <binding>
672 <command>nasal</command>
673 <script>
674 setprop("/input/joysticks/js/saitek-x52-i",1)
675 </script>
676 </binding>
677 <mod-up><binding>
678 <command>nasal</command>
679 <script>
680 setprop("/input/joysticks/js/saitek-x52-i",0)
681 </script>
682 </binding></mod-up>
683 </button>
684
685
686 <!-- Parking brake :: unbound function -->
687 <button n="666">
688 <desc>Toggle parking brake on or off</desc>
689 <binding>
690 <command>property-toggle</command>
691 <property>/controls/gear/brake-parking</property>
692 </binding>
693 </button>
694
695 </PropertyList>