Debian Codegraph @

Input/Joysticks/Saitek/X52-pro.xml

raw symbols SCIP
1 <?xml version="1.0"?>
2 <!--
3 Based on X52.xml and Aviator.xml
4 Modified by Arvid Norlander; 2007-12-03
5 Modified by Keiran Smith <[email protected]>; 2012-10-10
6
7 This file is released under the GPL license version 2 or later.
8 -->
9
10 <!--
11 Common Axis/Buttons
12 + Roll/Pitch/Throttle/Rudder: As There are
13 + Top stick hat: Airelon / Elevator trim
14 + Bottom stick hat: View directions (Increase/Decrease visibility & Zoom In/Out when shifted)
15 + Throttle foreside hat: Up/down: View cycles (Shift: flaps up/down). Left/right: Rudder trim
16 + Throttle slider: Boost Control (if available)
17 + Trigger: Apply all brakes
18 + Trigger (fully pressed): Fire weapons
19 + Fire button: Toggle parking brake
20 + Stick button "A": Gear up (Shift: gear down)
21 + Stick button "B": HUD master switch
22 + Stick button "C": Reset view (hackish) (shift: Toggle speedbrake)
23 + Pinkie button: Shift switch
24 + Throttle button "D": Right brake
25 + Throttle button "E": Left brake
26 + Throttle button "i": PTT (Push to talk, for fgcom)
27 + T1/T2: Hook up/down (Increase/Decrease spoilers when shifted)
28 + T3/T4: Increase/Decrease slats
29 + T5/T6: Increase/Decrease Speedbrake (Increase/Decrease magneto when shifted)
30
31 The modes below has been selected to provide generic functions even if there is
32 no specific support for the current aircraft. Mode 3 is likely best if there is
33 support for the aircraft in question.
34
35 Mode 1: Propeller Aircraft
36 + Top rotary dial: Mixture
37 + Bottom rotary dial: Prop Advance
38
39 Mode 2: Jet Aircraft
40 + Top rotary dial: Carb Heat
41
42 Mode 3: Aircraft specific.
43 Harrier:
44 + Throttle:
45 * Bottom "rotary dial" Thrust vector
46 Lightning:
47 + Throttle:
48 * Shifted "D" Braking chute
49
50 Linux Axis Numbers (no idea about window/mac ones, and they are not same as plain X52 axis numbers on linux at least):
51 0 Roll ........................................... (positive == right)
52 1 Pitch .......................................... (positive == down/back/nose-up)
53 2 Throttle ....................................... (positive == back/down/idle)
54 3 Bottom "rotary dial" on the throttle ........... (positive == CW)
55 4 Top "rotary dial" on the throttle .............. (positive == CCW)
56 5 Rocker switch ("rudder" control) on the throttle (positive == right)
57 6 Slider on the throttle ......................... (positive == forward)
58 7 Lower right hat horizontal axis ................ (positive == right)
59 8 Lower right hat vertical axis .................. (positive == down)
60 9 Mouse Y (positive = up) (Please don't use this, some of us want to map this to mouse in X)
61 10 Mouse X (positive = right) (Please don't use this, some of us want to map this to mouse in X)
62
63 Mac Axis Numbers Added by Keiran "Affix" Smith <[email protected]> October 2012
64
65 0 Aileron(Roll)
66 1 Elevator(Pitch)
67 2 Rudder
68 3 Throttle
69 4 Throttle Top Rotary Dial
70 5 Throttle Bottom Rotary Dial
71 6 Throttle Slider
72 7 Stick Hat Switch (Bottom)
73 8 Stick Hat Switch (Top)
74 9 Mouse Y
75 10 Mouse X
76
77 Button Numbers (Probably identical b/w Linux/Windows/Mac):
78 0 Trigger (half pressed)
79 1 Stick top "Fire" switch
80 2 Stick top "A" switch
81 3 Stick top "B" switch
82 4 Stick top "C" switch
83 5 Stick pinkie switch
84 6 Throttle "D" switch
85 7 Throttle "E" switch
86 8 T1
87 9 T2
88 10 T3
89 11 T4
90 12 T5
91 13 T6
92 14 Trigger (fully pressed)
93 15 Throttle mouse switch (Please don't use this, some of us want to map this to mouse in X)
94 16 Throttle forefinger wheel scroll down
95 17 Throttle forefinger wheel scroll up
96 18 Throttle forefinger wheel click
97 19 Upper left hat in "up" position
98 20 Upper left hat in "right" position
99 21 Upper left hat in "down" position
100 22 Upper left hat in "left" position
101 23 Throttle forefinger hat in "up/back" position
102 24 Throttle forefinger hat in "right" position
103 25 Throttle forefinger hat in "down/forward" position
104 26 Throttle forefinger hat in "left" position
105 27 Mode 1
106 28 Mode 2
107 29 Mode 3
108 30 Throttle "i" switch
109 31 Function wheel (below MFD) click (don't use, it is for timer)
110 32 START/STOP (don't use, for features in joystick itself)
111 33 RESET (don't use, for features in joystick itself)
112 34 Function wheel (below MFD) up
113 35 Function wheel (below MFD) down
114 36 MFD-select wheel below MFD up
115 37 MFD-select wheel below MFD down
116 38 MFD-select wheel below MFD click
117
118 $Id$
119 -->
120 <PropertyList>
121
122 <name>Saitek X52 Pro Flight Control System</name>
123 <name>Saitek X52 Pro Flight Controller</name>
124 <name>Saitek Saitek X52 Pro Flight Control System</name>
125
126 <!-- Custom section for storing some properties, based on Aviator.xml -->
127 <data>
128 <modifier type="bool">false</modifier>
129 <mode type="int">0</mode>
130 </data>
131
132 <nasal>
133 <script>
134 <![CDATA[
135 var self = cmdarg().getParent();
136 var data = self.getNode("data");
137 var modifier = data.getNode("modifier");
138 var mode = data.getNode("mode");
139 # This does not change during a session.
140 # Not called plain "aircraft" to prevent
141 # overwriting the Nasal/aircraft.nas scope
142 # as we need to access that too from here.
143 var aircraftModel = getprop("/sim/aircraft");
144 ]]>
145 </script>
146 </nasal>
147
148 <axis>
149 <number>
150 <mac>0</mac>
151 <unix>0</unix>
152 <windows>0</windows>
153 </number>
154 <desc>Aileron</desc>
155 <binding>
156 <command>property-scale</command>
157 <property>/controls/flight/aileron</property>
158 <squared type="bool">true</squared>
159 </binding>
160 </axis>
161
162 <axis>
163 <number>
164 <mac>1</mac>
165 <unix>1</unix>
166 <windows>1</windows>
167 </number>
168 <desc>Elevator</desc>
169 <binding>
170 <command>property-scale</command>
171 <property>/controls/flight/elevator</property>
172 <factor type="double">-1.0</factor>
173 <squared type="bool">true</squared>
174 </binding>
175 </axis>
176
177 <axis>
178 <number>
179 <mac>2</mac>
180 <unix>5</unix>
181 <windows>5</windows>
182 </number>
183 <desc>Rudder</desc>
184 <binding>
185 <command>property-scale</command>
186 <property>/controls/flight/rudder</property>
187 </binding>
188 </axis>
189
190 <!-- Bottom stick hat -->
191 <axis>
192 <number>
193 <mac>7</mac>
194 <unix>7</unix>
195 <windows>7</windows>
196 </number>
197 <desc>View Direction; Shift: Increase/Decrease visibility</desc>
198 <low>
199 <repeatable>true</repeatable>
200 <binding>
201 <command>nasal</command>
202 <script>
203 <![CDATA[
204 if (modifier.getValue()) {
205 fgcommand("increase-visibility");
206 } else {
207 view.panViewDir(1);
208 }
209 ]]>
210 </script>
211 </binding>
212 </low>
213 <high>
214 <repeatable>true</repeatable>
215 <binding>
216 <command>nasal</command>
217 <script>
218 <![CDATA[
219 if (modifier.getValue()) {
220 fgcommand("decrease-visibility");
221 } else {
222 view.panViewDir(-1);
223 }
224 ]]>
225 </script>
226 </binding>
227 </high>
228 </axis>
229
230 <axis>
231 <number>
232 <mac>8</mac>
233 <unix>8</unix>
234 <windows>8</windows>
235 </number>
236 <desc>View Elevation; Shift: Increase/Decrease field of view</desc>
237 <low>
238 <repeatable>true</repeatable>
239 <binding>
240 <command>nasal</command>
241 <script>
242 <![CDATA[
243 if (modifier.getValue()) {
244 view.increase();
245 } else {
246 view.panViewPitch(1);
247 }
248 ]]>
249 </script>
250 </binding>
251 </low>
252 <high>
253 <repeatable>true</repeatable>
254 <binding>
255 <command>nasal</command>
256 <script>
257 <![CDATA[
258 if (modifier.getValue()) {
259 view.decrease();
260 } else {
261 view.panViewPitch(-1);
262 }
263 ]]>
264 </script>
265 </binding>
266 </high>
267 </axis>
268
269 <axis>
270 <number>
271 <mac>3</mac>
272 <unix>2</unix>
273 <windows>2</windows>
274 </number>
275 <desc>Throttle</desc>
276 <binding>
277 <command>nasal</command>
278 <script>controls.throttleAxis()</script>
279 </binding>
280 </axis>
281
282 <!-- Top Rotary dial on the throttle
283 <axis>
284 <number>
285 <mac>5</mac>
286 <unix>4</unix>
287 <windows>5</windows>
288 </number>
289 <desc>Mode1: Mixture; Mode2: Carb Heat</desc>
290 <binding>
291 <command>nasal</command>
292 <script>
293 <![CDATA[
294 var val = mode.getValue();
295 if (val == 1) {
296 controls.mixtureAxis();
297 } elsif (val == 2) {
298 controls.carbHeatAxis();
299 }
300 ]]>
301 </script>
302 </binding>
303 </axis> -->
304
305 <!-- Bottom Rotary dial on the throttle -->
306 <axis>
307 <number>
308 <mac>4</mac>
309 <unix>3</unix>
310 <windows>4</windows>
311 </number>
312 <desc>Mode1: Propeller Advance</desc>
313 <binding>
314 <command>nasal</command>
315 <script>
316 <![CDATA[
317 var val = mode.getValue();
318 if (val == 1) {
319 controls.propellerAxis(-1);
320 } elsif (val == 3) {
321 if (aircraftModel == "harrier") {
322 controls.mixtureAxis();
323 }
324 }
325 ]]>
326 </script>
327 </binding>
328 </axis>
329
330 <!-- Throttle slider; Please add Unix/Windows axis number -->
331 <axis>
332 <number>
333 <mac>6</mac>
334 <unix>5</unix>
335 <windows>6</windows>
336 </number>
337 <desc>Boost Control</desc>
338 <binding>
339 <command>nasal</command>
340 <script>
341 <![CDATA[
342 var val = cmdarg().getNode("setting").getValue();
343 if (getprop("/controls/engines/engine/raw-boost") != nil) {
344 # for j7w
345 props.setAll("/controls/engines/engine", "raw-boost", (val+1)/2);
346 } else {
347 # for other prop airplanes
348 props.setAll("/controls/engines/engine", "boost", (val+1)/2);
349 }
350 ]]>
351 </script>
352 </binding>
353 </axis>
354
355 <!-- Buttons -->
356
357 <!-- Trigger -->
358 <button n="0">
359 <desc>Brakes</desc>
360 <binding>
361 <command>nasal</command>
362 <script>controls.applyBrakes(1)</script>
363 </binding>
364 <mod-up>
365 <binding>
366 <command>nasal</command>
367 <script>controls.applyBrakes(0)</script>
368 </binding>
369 </mod-up>
370 </button>
371
372 <!-- Fire button -->
373 <button n="1">
374 <desc>Toggle parking brake on or off</desc>
375 <binding>
376 <command>nasal</command>
377 <script>
378 <![CDATA[
379 if (modifier.getValue()) {
380 var i = !getprop("/controls/engines/engine[0]/reverser");
381 props.setAll("/controls/engines/engine", "reverser", i);
382 gui.popupTip("ReverseThrust" ~ ["OFF", "ON"][i]);
383 } else {
384 controls.applyParkingBrake(1);
385 }
386 ]]>
387 </script>
388 </binding>
389 </button>
390
391 <!-- Button "A" -->
392 <button n="2">
393 <desc>Gear up; Shift: Gear down</desc>
394 <binding>
395 <command>nasal</command>
396 <script>
397 <![CDATA[
398 if (modifier.getValue()) {
399 controls.gearDown(1);
400 } else {
401 controls.gearDown(-1);
402 }
403 ]]>
404 </script>
405 </binding>
406 <mod-up>
407 <binding>
408 <command>nasal</command>
409 <script>controls.gearDown(0)</script>
410 </binding>
411 </mod-up>
412 </button>
413
414 <!-- Button "B" -->
415 <button n="3">
416 <desc>Cycle HUD colour</desc>
417 <binding>
418 <command>nasal</command>
419 <script>aircraft.HUD.cycle_color()</script>
420 </binding>
421 </button>
422
423 <!-- button "C" -->
424 <button n="4">
425 <desc>Reset View (Shift: toggle speedbrake)</desc>
426 <binding>
427 <command>nasal</command>
428 <script>
429 <![CDATA[
430 if (modifier.getValue()) {
431 var c = getprop("/controls/flight/speedbrake");
432 if (c < 0.1)
433 setprop("/controls/flight/speedbrake", 1.0);
434 else
435 setprop("/controls/flight/speedbrake", 0.0);
436 } else {
437 view.resetView();
438 }
439 ]]>
440 </script>
441 </binding>
442 </button>
443
444 <!-- pinkie button -->
445 <button n="5">
446 <desc>Shift switch for X52</desc>
447 <binding>
448 <command>nasal</command>
449 <script>modifier.setBoolValue(1)</script>
450 </binding>
451 <mod-up>
452 <binding>
453 <command>nasal</command>
454 <script>modifier.setBoolValue(0)</script>
455 </binding>
456 </mod-up>
457 </button>
458
459 <!-- Button "D" -->
460 <button n="6">
461 <desc>Right Brake</desc>
462 <binding>
463 <command>nasal</command>
464 <script>controls.applyBrakes(1, 1)</script>
465 </binding>
466 <mod-up>
467 <binding>
468 <command>nasal</command>
469 <script>
470 <![CDATA[
471 if (modifier.getValue()) {
472 if (mode.getValue() == 3) {
473 if (aircraftModel == "lightning") {
474 setprop("/sim/model/lightning/controls/flight/chute_deployed", 1);
475 setprop("/sim/model/lightning/controls/flight/chute_open", 1);
476 }
477 }
478 } else {
479 controls.applyBrakes(0, 1);
480 }
481 ]]>
482 </script>
483 </binding>
484 </mod-up>
485 </button>
486
487 <!-- Button "E" -->
488 <button n="7">
489 <desc>Left Brake</desc>
490 <binding>
491 <command>nasal</command>
492 <script>controls.applyBrakes(1, -1)</script>
493 </binding>
494 <mod-up>
495 <binding>
496 <command>nasal</command>
497 <script>controls.applyBrakes(0, -1)</script>
498 </binding>
499 </mod-up>
500 </button>
501
502 <!-- Tail hook up on button T1; -->
503 <button n="8">
504 <desc>Tail hook up; Shift: Increase spoilers</desc>
505 <binding>
506 <command>nasal</command>
507 <script>
508 <![CDATA[
509 if (modifier.getValue()) {
510 controls.stepSpoilers(1);
511 } else {
512 setprop("/controls/gear/tailhook", 0);
513 }
514 ]]>
515 </script>
516 </binding>
517 </button>
518
519 <!-- Tail hook down on button T2 -->
520 <button n="9">
521 <desc>Tail hook down; Shift: Decrease spoilers</desc>
522 <binding>
523 <command>nasal</command>
524 <script>
525 <![CDATA[
526 if (modifier.getValue()) {
527 controls.stepSpoilers(-1);
528 } else {
529 setprop("/controls/gear/tailhook", 1);
530 }
531 ]]>
532 </script>
533 </binding>
534 </button>
535
536 <!-- Slats control on the T3/T4 -->
537 <button n="10">
538 <desc>Flaps Up</desc>
539 <binding>
540 <command>nasal</command>
541 <script>
542 <![CDATA[
543 if(modifier.getValue()){
544 controls.flapsDown(0);
545 } else {
546 controls.flapsDown(-1);
547 }
548 ]]>
549 </script>
550 </binding>
551 </button>
552
553 <button n="11">
554 <desc>Flaps Down</desc>
555 <binding>
556 <command>nasal</command>
557 <script>controls.flapsDown(1)</script>
558 </binding>
559 </button>
560
561 <!-- Per mode functions on the T6/T5 -->
562 <button n="12">
563 <desc>Increase speedbrake; Shift: Increase Magneto</desc>
564 <binding>
565 <command>nasal</command>
566 <script>
567 <![CDATA[
568 if (modifier.getValue()) {
569 controls.stepMagnetos(1);
570 } else {
571 setprop("/controls/flight/speedbrake", 1);
572 }
573 ]]>
574 </script>
575 </binding>
576 </button>
577
578 <button n="13">
579 <desc>Decrease speedbrake; Shift: Decrease Magneto</desc>
580 <binding>
581 <command>nasal</command>
582 <script>
583 <![CDATA[
584 if (modifier.getValue()) {
585 controls.stepMagnetos(-1);
586 } else {
587 setprop("/controls/flight/speedbrake", 0);
588 }
589 ]]>
590 </script>
591 </binding>
592 </button>
593
594 <!-- Button "Trigger Maximum pressed" -->
595 <button n="14">
596 <desc>Fire weapons</desc>
597 <binding>
598 <command>nasal</command>
599 <script>controls.trigger(1)</script>
600 </binding>
601 <mod-up>
602 <binding>
603 <command>nasal</command>
604 <script>controls.trigger(0)</script>
605 </binding>
606 </mod-up>
607 </button>
608
609 <!-- Trim (upper) hat on the stick -->
610 <button n="19">
611 <desc>Elevator trim down</desc>
612 <repeatable type="bool">true</repeatable>
613 <binding>
614 <command>nasal</command>
615 <script>
616 <![CDATA[
617 if (modifier.getValue()) {
618 setprop("/controls/flight/elevator-trim", 0);
619 } else {
620 controls.elevatorTrim(1);
621 }
622 ]]>
623 </script>
624 </binding>
625 </button>
626
627 <button n="20">
628 <desc>Aileron trim right</desc>
629 <repeatable type="bool">true</repeatable>
630 <binding>
631 <command>nasal</command>
632 <script>
633 <![CDATA[
634 if (modifier.getValue()) {
635 setprop("/controls/flight/aileron-trim", 0);
636 } else {
637 controls.aileronTrim(1);
638 }
639 ]]>
640 </script>
641 </binding>
642 </button>
643
644 <button n="21">
645 <desc>Elevator trim up</desc>
646 <repeatable type="bool">true</repeatable>
647 <binding>
648 <command>nasal</command>
649 <script>
650 <![CDATA[
651 if (modifier.getValue()) {
652 setprop("/controls/flight/elevator-trim", 0);
653 } else {
654 controls.elevatorTrim(-1);
655 }
656 ]]>
657 </script>
658 </binding>
659 </button>
660
661 <button n="22">
662 <desc>Aileron trim left</desc>
663 <repeatable type="bool">true</repeatable>
664 <binding>
665 <command>nasal</command>
666 <script>
667 <![CDATA[
668 if (modifier.getValue()) {
669 setprop("/controls/flight/aileron-trim", 0);
670 } else {
671 controls.aileronTrim(-1);
672 }
673 ]]>
674 </script>
675 </binding>
676 </button>
677
678 <!-- Throttle foreside hat -->
679 <button n="23">
680 <desc>Scroll in reverse through views (shift: flaps up).</desc>
681 <binding>
682 <command>nasal</command>
683 <script>
684 <![CDATA[
685 if (modifier.getValue()) {
686 controls.flapsDown(-1);
687 } else {
688 view.stepView(-1);
689 }
690 ]]>
691 </script>
692 </binding>
693 <mod-up>
694 <binding>
695 <command>nasal</command>
696 <script>
697 <![CDATA[
698 if (modifier.getValue()) {
699 controls.flapsDown(0);
700 }
701 ]]>
702 </script>
703 </binding>
704 </mod-up>
705 </button>
706
707 <button n="24">
708 <desc>Rudder trim right</desc>
709 <repeatable type="bool">true</repeatable>
710 <binding>
711 <command>nasal</command>
712 <script>
713 <![CDATA[
714 if (modifier.getValue()) {
715 setprop("/controls/flight/rudder-trim", 0);
716 } else {
717 controls.rudderTrim(1);
718 }
719 ]]>
720 </script>
721 </binding>
722 </button>
723
724 <button n="25">
725 <desc>Scroll views (shift: flaps down).</desc>
726 <binding>
727 <command>nasal</command>
728 <script>
729 <![CDATA[
730 if (modifier.getValue()) {
731 controls.flapsDown(1);
732 } else {
733 view.stepView(1);
734 }
735 ]]>
736 </script>
737 </binding>
738 <mod-up>
739 <binding>
740 <command>nasal</command>
741 <script>
742 <![CDATA[
743 if (modifier.getValue()) {
744 controls.flapsDown(0);
745 }
746 ]]>
747 </script>
748 </binding>
749 </mod-up>
750 </button>
751
752 <button n="26">
753 <desc>Rudder trim left</desc>
754 <repeatable type="bool">true</repeatable>
755 <binding>
756 <command>nasal</command>
757 <script>
758 <![CDATA[
759 if (modifier.getValue()) {
760 setprop("/controls/flight/rudder-trim", 0);
761 } else {
762 controls.rudderTrim(-1);
763 }
764 ]]>
765 </script>
766 </binding>
767 </button>
768
769 <!-- mode switch (buttons 27-29) -->
770 <button n="27">
771 <desc>Mode 1</desc>
772 <binding>
773 <command>nasal</command>
774 <script>mode.setIntValue(1)</script>
775 </binding>
776 </button>
777
778 <button n="28">
779 <desc>Mode 2</desc>
780 <binding>
781 <command>nasal</command>
782 <script>mode.setIntValue(2)</script>
783 </binding>
784 </button>
785
786 <button n="29">
787 <desc>Mode 3</desc>
788 <binding>
789 <command>nasal</command>
790 <script>mode.setIntValue(3)</script>
791 </binding>
792 </button>
793
794 <!-- "i" button -->
795 <button n="30">
796 <desc>PTT (for fgcom)</desc>
797 <binding>
798 <command>nasal</command>
799 <script>controls.ptt(1)</script>
800 </binding>
801 <mod-up>
802 <binding>
803 <command>nasal</command>
804 <script>controls.ptt(0)</script>
805 </binding>
806 </mod-up>
807 </button>
808
809 </PropertyList>