Debian Codegraph @

Input/Joysticks/Logitech/g940.xml

raw symbols SCIP
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3 Logitech, Inc. Flight System G940 configuration for Flightgear.
4 Version 2.
5 © 2011, 2013, 2014 Martin Měřinský, [email protected], GPLv2 or later.
6
7 Axes:
8 0 - Stick left/right - Aileron
9 1 - Stick forward/backward - Elevator
10 2 - Pedals rudder - Rudder
11 3 - Pedal right break - Right differential break
12 4 - Pedal left break - Left differential break
13 5 - TRIM3 - Aileron trim
14 6 - Trohttle right - Throttle right engine
15 7 - Throttle left - Throttle left engine
16 8 - R1 - Mixture
17 9 - R2 - Propeller pitch
18 10 - Stick upper hat left/right -
19 11 - Stick upper hat up/down -
20 12 - Stick lower hat left/right - View direction
21 13 - Stick lower hat up/down - View elevation
22 14 - Throttle lower hat left/right - View zoom in/out
23 15 - Throttle lower hat up/down - Reset zoom to default/for greater overview
24 16 - Throttle upper hat left/right -
25 17 - Throttle upper hat up/down -
26
27 Buttons:
28 0 - S0 - Fire primary weapon
29 1 - FIRE - Fire secondary weapon and smoke on/off toggle
30 2 - S1 - Drop bombs
31 3 - S2 - Master arm toggle (cycle through modes)
32 4 - S3 - Flare release
33 5 - S4 - View cycle
34 6 - S5 - Smoke
35 7 - Stick upper hat push -
36 8 - S0 second position - Fire primary and secondary weapon and smoke on/off toggle
37 9 - T1 - Flaps up
38 10 - T2 - Flaps down
39 11 - T3 - Airbrake toggle
40 12 - T4 - Reverse thrust toggle
41 13 - P1 - Tailhook up/down toggle
42 14 - P2 - Floats up/down toggle
43 15 - P3 - External fuel tanks jettison
44 16 - P4 - Wing fold or oversweep toggle
45 17 - P5 - Landing gear up/down toggle
46 18 - P6 - Watter rudder up/down toggle
47 19 - P7 - Landing drag parachute reapack/deploy/jettison
48 20 - P8 - Refueling probe toggle
49
50 Known issues:
51 TRIM1, TRIM2, MODE, axis 16 and 17 do not work in GNU/Linux
52 (js-demo nor Flightgear).
53
54 Flightgear does not allow you to control "left" and "right" engines if you have
55 even number of engines and all engines if you have odd number of engines.
56 This config file controls all engines at once, although you have two hardware
57 axis. With simple editing, you can control throttle of engines 0 and 1.
58
59 Properties for plane features in Flightgear are not standardized. So the same
60 thing is done using different properties on different planes and you may see
61 errors "undefined symbol" in console. Eg.:
62 Nasal runtime error: undefined symbol: f14
63 at /input/joysticks/js/button[20]/binding, line 1
64
65 Flightgear cannot invert left/right "lookat" view, so this is done using Nasal
66 and thus it works when Flightgear is paused, unlike view elevation (up/down).
67 -->
68 <PropertyList>
69
70 <name type="string">G940</name> <!-- GNU/Linux. -->
71
72 <!-- Stick ************************************************************ -->
73
74 <axis n="0">
75 <desc>Aileron</desc>
76 <binding>
77 <command>property-scale</command>
78 <property>/controls/flight/aileron</property>
79 </binding>
80 </axis>
81
82 <axis n="1">
83 <desc>Elevator</desc>
84 <binding>
85 <command>property-scale</command>
86 <property>/controls/flight/elevator</property>
87 <factor type="double">-1.0</factor> <!-- Reverse axis. -->
88 </binding>
89 </axis>
90
91 <axis n="5">
92 <desc>Aileron trim</desc>
93 <binding>
94 <command>property-scale</command>
95 <property>/controls/flight/aileron-trim</property>
96 </binding>
97 </axis>
98
99 <button n="5">
100 <desc>View cycle</desc>
101 <repeatable>false</repeatable>
102 <binding>
103 <command>nasal</command>
104 <script>
105 view.stepView(1);
106 #gui.popupTip(sprintf("View index: %d, view type: %s", getprop("sim/current-view/view-number"), getprop("/sim/current-view/type")));
107 </script>
108 </binding>
109 </button>
110
111 <axis>
112 <desc>View direction</desc>
113 <number>
114 <unix>12</unix>
115 </number>
116 <low>
117 <desc>View left</desc>
118 <repeatable>true</repeatable>
119 <binding>
120 <!--
121 This also works, but LookAt views have inverted left/right.
122 <command>property-adjust</command>
123 <property>/sim/current-view/goal-heading-offset-deg</property>
124 <step type="double">3.0</step>
125 -->
126 <command>nasal</command>
127 <script>
128 var valueDelta = -3.0;
129 if (getprop("/sim/current-view/type") == "lookat")
130 {
131 valueDelta = 3.0;
132 }
133 setprop("/sim/current-view/heading-offset-deg", getprop("/sim/current-view/heading-offset-deg") - valueDelta);
134 </script>
135 </binding>
136 </low>
137 <high>
138 <desc>View right</desc>
139 <repeatable>true</repeatable>
140 <binding>
141 <!--
142 This also works, but LookAt views have inverted left/right.
143 <command>property-adjust</command>
144 <property>/sim/current-view/goal-heading-offset-deg</property>
145 <step type="double">-3.0</step>
146 -->
147 <command>nasal</command>
148 <script>
149 var valueDelta = -3.0;
150 if (getprop("/sim/current-view/type") == "lookat")
151 {
152 valueDelta = 3.0;
153 }
154 setprop("/sim/current-view/heading-offset-deg", getprop("/sim/current-view/heading-offset-deg") + valueDelta);
155 </script>
156 </binding>
157 </high>
158 </axis>
159
160 <axis>
161 <desc>View elevation</desc>
162 <number>
163 <unix>13</unix>
164 </number>
165 <low>
166 <desc>View down</desc>
167 <repeatable>true</repeatable>
168 <binding>
169 <command>property-adjust</command>
170 <property>/sim/current-view/goal-pitch-offset-deg</property>
171 <step type="double">3.0</step>
172 </binding>
173 </low>
174 <high>
175 <desc>View up</desc>
176 <repeatable>true</repeatable>
177 <binding>
178 <command>property-adjust</command>
179 <property>/sim/current-view/goal-pitch-offset-deg</property>
180 <step type="double">-3.0</step>
181 </binding>
182 </high>
183 </axis>
184
185 <button n="0">
186 <desc>Fire primary weapon</desc>
187 <binding>
188 <command>nasal</command>
189 <script>
190 setprop("/controls/armament/trigger", 1);
191 setprop("ai/submodels/trigger", 1);
192 </script>
193 </binding>
194 <mod-up>
195 <binding>
196 <command>nasal</command>
197 <script>
198 setprop("/controls/armament/trigger", 0);
199 setprop("ai/submodels/trigger", 0);
200 </script>
201 </binding>
202 </mod-up>
203 </button>
204
205 <button n="1">
206 <desc>Fire secondary weapon</desc>
207 <binding>
208 <command>nasal</command>
209 <script>
210 setprop("/controls/armament/trigger1", 1);
211 setprop("ai/submodels/trigger1", 1);
212 </script>
213 </binding>
214 <mod-up>
215 <binding>
216 <command>nasal</command>
217 <script>
218 setprop("/controls/armament/trigger1", 0);
219 setprop("ai/submodels/trigger1", 0);
220 </script>
221 </binding>
222 </mod-up>
223 </button>
224
225 <button n="2">
226 <desc>Drop bombs</desc>
227 <repeatable>false</repeatable>
228 <binding>
229 <command>nasal</command>
230 <script>
231 setprop("ai/submodels/red-beard-released", 1);
232 </script>
233 </binding>
234 </button>
235
236 <button n="3">
237 <desc>Master arm toggle (cycle through modes)</desc>
238 <repeatable>false</repeatable>
239 <binding>
240 <command>nasal</command>
241 <script>
242 f14.master_arm_cycle();
243 </script>
244 </binding>
245 </button>
246
247 <button n="4">
248 <desc>Flare release</desc>
249 <binding>
250 <command>nasal</command>
251 <script>
252 setprop("ai/submodels/submodel[0]/flare-release", 1);
253 </script>
254 </binding>
255 <mod-up>
256 <binding>
257 <command>nasal</command>
258 <script>
259 setprop("ai/submodels/submodel[0]/flare-release", 0);
260 </script>
261 </binding>
262 </mod-up>
263 </button>
264
265 <button n="6">
266 <desc>Smoke on/off toggle</desc>
267 <binding>
268 <command>nasal</command>
269 <script>
270 # Smoke toggle z50lx.
271 if (getprop("/controls/smoke") == 1)
272 smokeNextState = 0;
273 else
274 smokeNextState = 1;
275 setprop("/controls/smoke", smokeNextState);
276
277 # Smoke toggle Su-26M2.
278 if (getprop("/control/smoke") == 1)
279 smokeNextState = 0;
280 else
281 smokeNextState = 1;
282 setprop("/control/smoke", smokeNextState);
283 </script>
284 </binding>
285 </button>
286
287 <button n="8">
288 <desc>Fire primary and secondary weapon and smoke on/off toggle</desc>
289 <binding>
290 <command>nasal</command>
291 <script>
292 setprop("/controls/armament/trigger", 1);
293 setprop("ai/submodels/trigger", 1);
294 setprop("/controls/armament/trigger1", 1);
295 setprop("ai/submodels/trigger1", 1);
296 # Also smoke toggle.
297 if (getprop("/controls/smoke") == 1)
298 smokeNextState = 0;
299 else
300 smokeNextState = 1;
301 setprop("/controls/smoke", smokeNextState);
302 </script>
303 </binding>
304 <mod-up>
305 <binding>
306 <command>nasal</command>
307 <script>
308 setprop("/controls/armament/trigger", 0);
309 setprop("ai/submodels/trigger", 0);
310 setprop("/controls/armament/trigger1", 0);
311 setprop("ai/submodels/trigger1", 0);
312 </script>
313 </binding>
314 </mod-up>
315 </button>
316
317 <!-- Throttle ********************************************************* -->
318
319 <axis>
320 <desc>Throttle right engine</desc>
321 <number>
322 <unix>6</unix>
323 </number>
324 <binding>
325 <!-- If you want to control left and right engine, use this.
326 <command>property-scale</command>
327 <property>/controls/engines/engine[1]/throttle</property>
328 <offset type="double">-1.0</offset>
329 <factor type="double">-0.5</factor>
330 -->
331 <command>nasal</command>
332 <script>controls.throttleAxis()</script>
333
334
335 </binding>
336 </axis>
337
338 <axis>
339 <desc>Throttle left engine</desc>
340 <number>
341 <unix>7</unix>
342 </number>
343 <binding>
344 <command>property-scale</command>
345 <property>/controls/engines/engine[0]/throttle</property>
346 <offset type="double">-1.0</offset>
347 <factor type="double">-0.5</factor>
348 </binding>
349 </axis>
350
351 <axis>
352 <desc>Mixture</desc>
353 <number>
354 <unix>9</unix>
355 </number>
356 <binding>
357 <command>property-scale</command>
358 <property>/controls/engines/engine/mixture</property>
359 <offset type="double">-1.0</offset>
360 <factor type="double">-0.5</factor>
361 </binding>
362 </axis>
363
364 <axis>
365 <desc>Propeller pitch</desc>
366 <number>
367 <unix>8</unix>
368 </number>
369 <binding>
370 <command>property-scale</command>
371 <property>/controls/engines/engine/propeller-pitch</property>
372 <offset type="double">-1.0</offset>
373 <factor type="double">-0.5</factor>
374 </binding>
375 </axis>
376
377 <axis>
378 <desc>View zoom</desc>
379 <number>
380 <unix>14</unix>
381 </number>
382 <low>
383 <desc>Zoom out</desc>
384 <repeatable>true</repeatable>
385 <binding>
386 <command>nasal</command>
387 <script>
388 view.increase();
389 </script>
390 </binding>
391 </low>
392 <high>
393 <desc>Zoom in</desc>
394 <repeatable>true</repeatable>
395 <binding>
396 <command>nasal</command>
397 <script>view.decrease()</script>
398 </binding>
399 </high>
400 </axis>
401
402 <axis>
403 <desc>Reset zoom</desc>
404 <number>
405 <unix>15</unix>
406 </number>
407 <low>
408 <desc>Reset zoom to default</desc>
409 <repeatable>false</repeatable>
410 <binding>
411 <command>property-assign</command>
412 <property>/sim/current-view/field-of-view</property>
413 <property>/sim/view/config/default-field-of-view-deg</property>
414 </binding>
415 </low>
416 <high>
417 <desc>Reset zoom for greater overview</desc>
418 <repeatable>false</repeatable>
419 <binding>
420 <command>nasal</command>
421 <script>
422 setprop("/sim/current-view/field-of-view", 100);
423 </script>
424 </binding>
425 </high>
426 </axis>
427
428 <button n="9">
429 <desc>Flaps up</desc>
430 <binding>
431 <command>nasal</command>
432 <script>controls.flapsDown(-1)</script>
433 </binding>
434 <mod-up>
435 <binding>
436 <command>nasal</command>
437 <script>controls.flapsDown(0)</script>
438 </binding>
439 </mod-up>
440 </button>
441
442 <button n="10">
443 <desc>Flaps down</desc>
444 <binding>
445 <command>nasal</command>
446 <script>controls.flapsDown(1)</script>
447 </binding>
448 <mod-up>
449 <binding>
450 <command>nasal</command>
451 <script>controls.flapsDown(0)</script>
452 </binding>
453 </mod-up>
454 </button>
455
456 <button n="11">
457 <desc>Airbrake toggle</desc>
458 <binding>
459 <command>nasal</command>
460 <script>
461 if (getprop("/controls/flight/speedbrake") == 1)
462 speedbrakeNextState = 0;
463 else
464 speedbrakeNextState = 1;
465 setprop("/controls/flight/speedbrake", speedbrakeNextState);
466 </script>
467 </binding>
468 </button>
469
470 <button n="12">
471 <desc>Reverse thrust toggle</desc>
472 <binding>
473 <command>nasal</command>
474 <script>
475 reverserNextState = !getprop("/controls/engines/engine[0]/reverser");
476 props.setAll("/controls/engines/engine", "reverser", reverserNextState);
477 </script>
478 </binding>
479 </button>
480
481 <button n="13">
482 <desc>Landing tailhook toggle</desc>
483 <repeatable>false</repeatable>
484 <binding>
485 <command>nasal</command>
486 <script>
487 if (getprop("/controls/gear/tailhook") == 1)
488 hookNextState = 0;
489 else
490 hookNextState = 1;
491 setprop("/controls/gear/tailhook", hookNextState); # F-14b
492 setprop("fdm/jsbsim/systems/hook/tailhook-cmd-norm", hookNextState); # F-16
493 </script>
494 </binding>
495 </button>
496
497 <button n="14">
498 <desc>Floats up/down toggle</desc>
499 <repeatable>false</repeatable>
500 <binding>
501 <command>nasal</command>
502 <script>
503 if (getprop("/controls/gear/float-down") == 1)
504 floatNextState = 0;
505 else
506 floatNextState = 1;
507 setprop("/controls/gear/float-down", floatNextState);
508 </script>
509 </binding>
510 </button>
511
512 <button n="15">
513 <desc>External fuel tanks jettison</desc>
514 <repeatable>false</repeatable>
515 <binding>
516 <command>nasal</command>
517 <script>
518 # Lightning.
519 setprop("/sim/model/lightning/controls/tank_jettisoned", 1);
520 # F-14b
521 #setprop("/sim/model/f-14b/systems/external-loads/external-tanks", 0);
522 f14.toggle_ext_tank_selected();
523 </script>
524 </binding>
525 </button>
526
527 <button n="16">
528 <desc>Wing fold or oversweep toggle</desc>
529 <repeatable>false</repeatable>
530 <binding>
531 <command>nasal</command>
532 <script>
533 f14.toggleOversweep();
534 </script>
535 </binding>
536 </button>
537
538 <button n="17">
539 <desc>Landing gear toggle</desc>
540 <repeatable>false</repeatable>
541 <binding>
542 <command>nasal</command>
543 <script>controls.gearToggle()</script>
544 </binding>
545 </button>
546
547 <button n="18">
548 <desc>Watter ruder toggle</desc>
549 <repeatable>false</repeatable>
550 <binding>
551 <command>nasal</command>
552 <script>
553 if (getprop("/controls/gear/water-rudder-down") == 1)
554 waterRudderNextState = 0;
555 else
556 waterRudderNextState = 1;
557 interpolate("/controls/gear/water-rudder-down", waterRudderNextState, 2.5);
558 </script>
559 </binding>
560 </button>
561
562 <button n="19">
563 <desc>Drag parachute repack - deploy - jettison</desc>
564 <repeatable>false</repeatable>
565 <binding>
566 <command>nasal</command>
567 <script>
568 # Chute states:
569 # 0 ... repacked
570 # 1 ... deployed
571 # 2 ... jettisoned
572 if (chuteState == 0)
573 {
574 print("Command to chute (prepare for automatic or) deployment.");
575 # F-117, prepare for automatic deployment.
576 setprop("/sim/model/controls/chute", 1);
577 # Lightning.
578 setprop("sim/model/lightning/controls/flight/chute_open", 1);
579 setprop("sim/model/lightning/controls/flight/chute_deployed", 1);
580 setprop("sim/model/lightning/controls/flight/chute_jettisoned", 0);
581 chuteState = 1;
582 }
583 else if (chuteState == 1)
584 {
585 print("Command to chute jettison.");
586 # F-117, jettsion is automatic.
587 setprop("/sim/model/controls/chute", 0);
588 setprop("/sim/model/controls/chute-available", 0);
589 # Lightning.
590 setprop("sim/model/lightning/controls/flight/chute_open", 1);
591 setprop("sim/model/lightning/controls/flight/chute_deployed", 1);
592 setprop("sim/model/lightning/controls/flight/chute_jettisoned", 1);
593 chuteState = 2;
594 }
595 else
596 {
597 print("Command to repack chute.");
598 # F-117.
599 setprop("/sim/model/controls/chute", 0);
600 setprop("/sim/model/controls/chute-available", 0);
601 # Lightning.
602 setprop("sim/model/lightning/controls/flight/chute_open", 0);
603 setprop("sim/model/lightning/controls/flight/chute_deployed", 0);
604 setprop("sim/model/lightning/controls/flight/chute_jettisoned", 0);
605 chuteState = 0;
606 }
607 </script>
608 </binding>
609 </button>
610
611 <button n="20">
612 <desc>Refueling probe toggle</desc>
613 <repeatable>false</repeatable>
614 <binding>
615 <command>nasal</command>
616 <script>f14.refuel_probe_switch_cycle();</script>
617 </binding>
618 </button>
619
620 <!-- Pedals *********************************************************** -->
621
622 <axis>
623 <desc>Rudder</desc>
624 <number>
625 <unix>2</unix>
626 </number>
627 <binding>
628 <command>property-scale</command>
629 <property>/controls/flight/rudder</property>
630 <power type="int">2</power>
631 </binding>
632 </axis>
633
634 <axis>
635 <number>
636 <unix>4</unix>
637 </number>
638 <desc>Left differential break</desc>
639 <binding>
640 <command>property-scale</command>
641 <property>/controls/gear/brake-left</property>
642 <offset>-1.0</offset>
643 <factor>-0.5</factor>
644 </binding>
645 </axis>
646
647 <axis>
648 <number>
649 <unix>3</unix>
650 </number>
651 <desc>Right differential break</desc>
652 <binding>
653 <command>property-scale</command>
654 <property>/controls/gear/brake-right</property>
655 <offset>-1.0</offset>
656 <factor>-0.5</factor>
657 </binding>
658 </axis>
659
660 </PropertyList>
661