Add the Cyborg Evo from Phillip Jones.
[fg:toms-fgdata.git] / Input / Joysticks / Saitek / Cyborg-Evo.xml
1 <!--
2 Joystick binding definitions for "Saitek Cyborg Evo" Joystick.
3
4 This file borrows heavily from "Cyborg-Gold-3d-USB.xml"
5
6 The Saitek Cyborg Evo is designed to be easily switchable between a 
7 left-handed or right handed person.  With that in mind {^, F1, F2} buttons 
8 on the left, and {^, F3, F4 } buttons on the right have repeated
9 functionality as the 'modifier' buttons.
10
11 Axis #  (direction)                     mapped to
12 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
13 axis 0: (left-right)            aileron
14 axis 1: (forward-backward)      elevator
15 axis 2: (slider)                        throttle
16 axis 3: (twist)                         rudder
17
18 ~~~~ Left Side Modifiers ~~~~
19 button 10:      "^"                             Modifier 1
20 button 6:       "F1"                    Modifier 2
21 button 7:       "F2"                    Modifier 3
22
23 ~~~~ Right Side Modifiers ~~~~
24 button 11:      "^"                             Modifier 1
25 button 8:       "F3"                    Modifier 2
26 button 9:       "F4"                    Modifier 3
27
28 Button #        (location)              No Mod                  Mod 1                           Mod 2                   Mod 3
29 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
30 button 0:       (trigger)               Brakes                  Parking Brake           Speed Brake             Thrust Reverse
31 button 1:       (middle)                Reset View              Reset All Trim          Cockpit View    Tail Wheel Lock
32 button 2:       (left)                  Flaps Up                Gear Up                         Zoom In                 #
33 button 3:       (right)                 Flaps Down              Gear Down                       Zoom Out                #
34 button 4:       (left of hat)   Previous View   Trim Rudder                     #                               #
35 button 5:       (right of hat)  Next View               Trim Rudder                     #                               #
36
37 axis 6: (hat left-right)        look l/r                Trim Aileron            Adj Mixture             #
38 axis 7: (hat up-down)           look u/d                Trim Elevator           Adj Propeller   #
39
40 -->
41
42 <PropertyList>
43
44 <name>Saitek Cyborg Evo</name>
45
46 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~ Axis Bindings ~~~~~~~~~~~~~~~~~~~~~~~~ -->
47
48 <axis n="0">
49         <desc>Aileron</desc>
50         <binding>
51                 <command>property-scale</command>
52                 <property>/controls/flight/aileron</property>
53                 <power type="double">2</power>
54         </binding>
55 </axis>
56
57 <axis n="1">
58         <desc>Elevator</desc>
59         <binding>
60                 <command>property-scale</command>
61                 <property>/controls/flight/elevator</property>
62                 <factor type="double">-1.0</factor>
63                 <power type="double">2</power>
64         </binding>
65 </axis>
66
67 <axis n="2">
68         <desc>Throttle</desc>
69         <binding>
70                 <command>nasal</command>
71                 <DEFANGED_script>controls.throttleAxis()</DEFANGED_script>
72         </binding>
73 </axis>
74
75 <axis n="3">
76         <desc>Rudder</desc>
77         <binding>
78                 <command>property-scale</command>
79                 <property>/controls/flight/rudder</property>
80                 <power type="double">2</power>
81         </binding>
82 </axis>
83
84 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~ Hat Switch ~~~~~~~~~~~~~~~~~~~~~~~~ -->
85 <axis n="6">
86         <desc>View Direction; Aileron Trim;</desc>
87         <low>
88                 <repeatable>true</repeatable>
89                 <binding>
90                         <command>nasal</command>
91                         <DEFANGED_script>
92                                 mod = getprop("/input/joysticks/js[0]/saitek-cyborg-evo-modifier");
93                                 if (mod == nil or mod == 0) {
94                                         v = getprop("/sim/current-view/view-number");
95                                         if (v == 0 or v == 4) {
96                                                 view.panViewDir(2);
97                                         } else {
98                                                 view.panViewDir(2);
99                                         }
100                                 } elsif (mod == 1) {
101                                         controls.aileronTrim(-0.75);
102                                 } elsif (mod == 2) {
103                                         controls.adjMixture(-2);
104                                 } elsif (mod == 3) {
105                                         #
106                                 }
107                         </DEFANGED_script>
108                 </binding>
109         </low>
110         <high>
111                 <repeatable>true</repeatable>
112                 <binding>
113                         <command>nasal</command>
114                         <DEFANGED_script>
115                                 mod = getprop("/input/joysticks/js[0]/saitek-cyborg-evo-modifier");
116                                 if (mod == nil or mod == 0) {
117                                         v = getprop("/sim/current-view/view-number");
118                                         if (v == 0 or v == 4) {
119                                                 view.panViewDir(-2);
120                                         } else {
121                                                 view.panViewDir(-2);
122                                         }
123                                 } elsif (mod == 1) {
124                                         controls.aileronTrim(0.75);
125                                 } elsif (mod == 2) {
126                                         controls.adjMixture(2);
127                                 } elsif (mod == 3) {
128                                         #
129                                 }
130                         </DEFANGED_script>
131                 </binding>
132         </high>
133 </axis>
134
135 <axis n="7">
136         <desc>View Elevation; Elevator Trim;</desc>
137         <low>
138                 <repeatable>true</repeatable>
139                 <binding>
140                         <command>nasal</command>
141                         <DEFANGED_script>
142                                 mod = getprop("/input/joysticks/js[0]/saitek-cyborg-evo-modifier");
143                                 if (mod == nil or mod == 0) {
144                                         view.panViewPitch(2);
145                                 } elsif (mod == 1) {
146                                         controls.elevatorTrim(-0.75);
147                                 } elsif (mod == 2) {
148                                         controls.adjPropeller(-1);
149                                 } elsif (mod == 3) {
150                                         #
151                                 }
152                         </DEFANGED_script>
153                 </binding>
154         </low>
155         <high>
156                 <repeatable>true</repeatable>
157                 <binding>
158                         <command>nasal</command>
159                         <DEFANGED_script>
160                                 mod = getprop("/input/joysticks/js[0]/saitek-cyborg-evo-modifier");
161                                 if (mod == nil or mod == 0) {
162                                         view.panViewPitch(-2);
163                                 } elsif (mod == 1) {
164                                         controls.elevatorTrim(0.75);
165                                 } elsif (mod == 2) {
166                                         controls.adjPropeller(1);
167                                 } elsif (mod == 3) {
168                                         #
169                                 }
170                         </DEFANGED_script>
171                 </binding>
172         </high>
173 </axis>
174
175
176 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~ Button Bindings ~~~~~~~~~~~~~~~~~~~~~~~~ -->
177  
178 <!-- Trigger Button - Brakes, Parking Brake, Thrust Reverser -->
179 <DEFANGED_button n="0">
180         <desc>Brakes</desc>
181         <repeatable type="bool">true</repeatable>
182         <binding>
183                 <command>nasal</command>
184                 <DEFANGED_script>
185                         mod = getprop("/input/joysticks/js[0]/saitek-cyborg-evo-modifier");
186                         if (mod == nil or mod == 0) {
187                                 interpolate("/controls/gear/brake-left", 1, 0.075);
188                                 interpolate("/controls/gear/brake-right", 1, 0.075);
189                         } elsif (mod == 1) {
190                                 setprop("/controls/gear/brake-left", 1);
191                                 setprop("/controls/gear/brake-right", 1);
192                         } elsif (mod == 2) {
193                                 #
194                         } elsif (mod == 3) {
195                                 #
196                         }
197                 </DEFANGED_script>
198         </binding>
199         <mod-up>
200         <repeatable type="bool">true</repeatable>
201         <binding>
202                 <command>nasal</command>
203                 <DEFANGED_script>
204                         mod = getprop("/input/joysticks/js[0]/saitek-cyborg-evo-modifier");
205                         if (mod == nil or mod == 0) {
206                                 interpolate("/controls/gear/brake-left", 0, 0.075);
207                                 interpolate("/controls/gear/brake-right", 0, 0.075);
208                         } elsif (mod == 1) {
209                                 brake = !getprop("/controls/gear/brake-parking");
210                                 setprop("/controls/gear/brake-parking", brake);
211                                 if (brake) {
212                                         gui.popupTip("Parking Brake ON");
213                                 } else {
214                                         gui.popupTip("Parking Brake OFF");
215                                 }
216                                 setprop("/controls/gear/brake-left", 0);
217                                 setprop("/controls/gear/brake-right", 0);
218                         } elsif (mod == 2) {
219                                 speedbrake = !getprop("/controls/flight/speedbrake");
220                                 setprop("/controls/flight/speedbrake", speedbrake);
221                         } elsif (mod == 3) {
222                                 reverser = !getprop("/controls/engines/engine[0]/reverser");
223                                 props.setAll("/controls/engines/engine", "reverser", reverser);
224                                 if (reverser) {
225                                         gui.popupTip("Thrust Reverser ON");
226                                 } else {
227                                         gui.popupTip("Thrust Reverser OFF");
228                                 }
229                         }
230                 </DEFANGED_script>
231         </binding>
232         </mod-up>
233 </DEFANGED_button>
234
235 <!-- Middle Button below Hat-switch, labeled "2" -->
236 <DEFANGED_button n="1">
237         <desc>Reset view; toggle tail-wheel lock; reset trim</desc>
238         <repeatable type="bool">false</repeatable>
239         <binding>
240                 <command>nasal</command>
241                 <DEFANGED_script>
242                         mod = getprop("/input/joysticks/js[0]/saitek-cyborg-evo-modifier");
243                         if (mod == nil or mod == 0) {
244                                 view.resetView();
245                         } elsif (mod == 1) {
246                                 setprop("/controls/flight/elevator-trim", 0);
247                                 setprop("/controls/flight/aileron-trim", 0);
248                                 setprop("/controls/flight/rudder-trim", 0);
249                         } elsif (mod == 2) {
250                                 setprop("/sim/current-view/view-number", 0);
251                                 view.resetView();
252                         } elsif (mod == 3) {
253                                 twlock = !getprop("/controls/gear/tailwheel-lock");
254                                 setprop("/controls/gear/tailwheel-lock", twlock);
255                                 if (twlock) {
256                                         gui.popupTip("Tail Wheel UNLOCKED");
257                                 } else {
258                                         gui.popupTip("Tail Wheel LOCKED");
259                                 }
260                         }
261                 </DEFANGED_script>
262         </binding>
263 </DEFANGED_button>
264
265 <!-- Left Button below Hat-switch, labeled "3" -->
266 <DEFANGED_button n="2">
267         <desc>Flaps Up; Gear up</desc>
268         <repeatable type="bool">false</repeatable>
269         <binding>
270                 <command>nasal</command>
271                 <DEFANGED_script>
272                         mod = getprop("/input/joysticks/js[0]/saitek-cyborg-evo-modifier");
273                         if (mod == nil or mod == 0) {
274                                 controls.stepFlaps(-1);
275                         } elsif (mod == 1) {
276                                 setprop("/controls/gear/gear-down", 0);
277                         } elsif (mod == 2) {
278                                 view.increase();
279                         } elsif (mod == 3) {
280                                 #
281                         }
282                 </DEFANGED_script>
283         </binding>
284 </DEFANGED_button>
285
286 <!-- Right Button below Hat-switch, labeled "4" -->
287 <DEFANGED_button n="3"><!-- right -->
288         <desc>Flaps Down; Gear down</desc>
289         <repeatable type="bool">false</repeatable>
290         <binding>
291                 <command>nasal</command>
292                 <DEFANGED_script>
293                         mod = getprop("/input/joysticks/js[0]/saitek-cyborg-evo-modifier");
294                         if (mod == nil or mod == 0) {
295                                 controls.stepFlaps(1);
296                         } elsif (mod == 1) {
297                                 setprop("/controls/gear/gear-down", 1);
298                         } elsif (mod == 2) {
299                                 view.decrease();
300                         } elsif (mod == 3) {
301                                 #
302                         }
303                 </DEFANGED_script>
304         </binding>
305 </DEFANGED_button>
306
307 <!-- Button left of Hat switch, Labeled '5' -->
308 <DEFANGED_button n="4">
309         <desc>Previous View</desc>
310         <repeatable type="bool">false</repeatable>
311         <binding>
312                 <command>nasal</command>
313                 <DEFANGED_script>
314                         mod = getprop("/input/joysticks/js[0]/saitek-cyborg-evo-modifier");
315                         if (mod == nil or mod == 0) {
316                                 view.stepView(-1);
317                         } elsif (mod == 1) {
318                                 controls.rudderTrim(-0.75);
319                         } elsif (mod == 2) {
320                                 #
321                         } elsif (mod == 3) {
322                                 #
323                         }
324                 </DEFANGED_script>
325         </binding>
326 </DEFANGED_button>
327
328 <!-- Button right of Hat switch, Labeled '6' -->
329 <DEFANGED_button n="5">
330         <desc>Next View</desc>
331         <repeatable type="bool">false</repeatable>
332         <binding>
333                 <command>nasal</command>
334                 <DEFANGED_script>
335                         mod = getprop("/input/joysticks/js[0]/saitek-cyborg-evo-modifier");
336                         if (mod == nil or mod == 0) {
337                                 view.stepView(1);
338                         } elsif (mod == 1) {
339                                 controls.rudderTrim(0.75);
340                         } elsif (mod == 2) {
341                                 #
342                         } elsif (mod == 3) {
343                                 #
344                         }
345                 </DEFANGED_script>
346         </binding>
347 </DEFANGED_button>
348
349 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~ Modifier Buttons ~~~~~~~~~~~~~~~~~~~~~~~~ -->
350
351 <!-- Left Side Button labeled ^ -->
352 <DEFANGED_button n="10">
353         <desc>Modifier 1</desc>
354         <repeatable type="bool">false</repeatable>
355         <binding>
356                 <command>nasal</command>
357                         <DEFANGED_script>
358                                 name = "/input/joysticks/js[0]/saitek-cyborg-evo-modifier";
359                                 setprop(name, 1);
360                         </DEFANGED_script>
361         </binding>
362         <mod-up>
363                 <binding>
364                         <command>nasal</command>
365                         <DEFANGED_script>
366                                 name = "/input/joysticks/js[0]/saitek-cyborg-evo-modifier";
367                                 setprop(name, 0);
368                         </DEFANGED_script>
369                 </binding>
370         </mod-up>
371 </DEFANGED_button>
372
373 <!-- Left Side Button labeled F1 -->
374 <DEFANGED_button n="6">
375         <desc>Modifier 2</desc>
376         <repeatable type="bool">false</repeatable>
377         <binding>
378                 <command>nasal</command>
379                 <DEFANGED_script>
380                         name = "/input/joysticks/js[0]/saitek-cyborg-evo-modifier";
381                         setprop(name, 2);
382                 </DEFANGED_script>
383         </binding>
384         <mod-up>
385                 <binding>
386                         <command>nasal</command>
387                         <DEFANGED_script>
388                                 name = "/input/joysticks/js[0]/saitek-cyborg-evo-modifier";
389                                 setprop(name, 0);
390                         </DEFANGED_script>
391                 </binding>
392         </mod-up>
393 </DEFANGED_button>
394
395 <!-- Left Side Button labeled F2 -->
396 <DEFANGED_button n="7">
397         <desc>Modifier 3</desc>
398         <repeatable type="bool">false</repeatable>
399         <binding>
400                 <command>nasal</command>
401                 <DEFANGED_script>
402                         name = "/input/joysticks/js[0]/saitek-cyborg-evo-modifier";
403                         setprop(name, 3);
404                 </DEFANGED_script>
405         </binding>
406         <mod-up>
407                 <binding>
408                         <command>nasal</command>
409                         <DEFANGED_script>
410                                 name = "/input/joysticks/js[0]/saitek-cyborg-evo-modifier";
411                                 setprop(name, 0);
412                         </DEFANGED_script>
413                 </binding>
414         </mod-up>
415 </DEFANGED_button>
416
417 <!-- Right Side Button labeled ^ -->
418 <DEFANGED_button n="11">
419         <desc>Modifier 1</desc>
420         <repeatable type="bool">false</repeatable>
421         <binding>
422                 <command>nasal</command>
423                         <DEFANGED_script>
424                                 name = "/input/joysticks/js[0]/saitek-cyborg-evo-modifier";
425                                 setprop(name, 1);
426                         </DEFANGED_script>
427         </binding>
428         <mod-up>
429                 <binding>
430                         <command>nasal</command>
431                         <DEFANGED_script>
432                                 name = "/input/joysticks/js[0]/saitek-cyborg-evo-modifier";
433                                 setprop(name, 0);
434                         </DEFANGED_script>
435                 </binding>
436         </mod-up>
437 </DEFANGED_button>
438
439 <!-- Right Side Button labeled F3 -->
440 <DEFANGED_button n="8">
441         <desc>Modifier 2</desc>
442         <repeatable type="bool">false</repeatable>
443         <binding>
444                 <command>nasal</command>
445                 <DEFANGED_script>
446                         name = "/input/joysticks/js[0]/saitek-cyborg-evo-modifier";
447                         setprop(name, 2);
448                 </DEFANGED_script>
449         </binding>
450         <mod-up>
451                 <binding>
452                         <command>nasal</command>
453                         <DEFANGED_script>
454                                 name = "/input/joysticks/js[0]/saitek-cyborg-evo-modifier";
455                                 setprop(name, 0);
456                         </DEFANGED_script>
457                 </binding>
458         </mod-up>
459 </DEFANGED_button>
460
461 <!-- Right Side Button labeled F4 -->
462 <DEFANGED_button n="9">
463         <desc>Modifier 3</desc>
464         <repeatable type="bool">false</repeatable>
465         <binding>
466                 <command>nasal</command>
467                 <DEFANGED_script>
468                         name = "/input/joysticks/js[0]/saitek-cyborg-evo-modifier";
469                         setprop(name, 3);
470                 </DEFANGED_script>
471         </binding>
472         <mod-up>
473                 <binding>
474                         <command>nasal</command>
475                         <DEFANGED_script>
476                                 name = "/input/joysticks/js[0]/saitek-cyborg-evo-modifier";
477                                 setprop(name, 0);
478                         </DEFANGED_script>
479                 </binding>
480         </mod-up>
481 </DEFANGED_button>
482
483 </PropertyList>