CanvasND: Add 777 track bug implementation
[fg:toms-fgdata.git] / keyboard.xml
1 <?xml version="1.0"?>
2 <!--
3 Key binding definitions.
4
5 Regular keycodes go up to 255; special keys start at 256, and can be
6 calculated by adding 256 to the GLUT key value in glut.h.
7
8 All Nasal code in this file lives in a common Nasal namespace __kbd.
9 All <nasal> blocks on the top level are executed in the order from
10 top down before the key bindings are parsed.
11 -->
12
13 <PropertyList>
14  <nasal>
15   <script>
16       # /devices/status/keyboard/event/modifier/ and /devices/status/keyboard/
17       # don't only have one BOOL child per modifier, but also contain the
18       # modifier bitmap themselves, using these bit values:
19       var mod = { shift: 1, ctrl: 2, alt: 4, meta: 8, super: 16, hyper: 32 };
20
21       var modifiers = props.globals.getNode("/devices/status/keyboard");
22       var shift = props.globals.getNode("/devices/status/keyboard/shift");
23       var ctrl = props.globals.getNode("/devices/status/keyboard/ctrl");
24       var alt = props.globals.getNode("/devices/status/keyboard/alt");
25
26       var space_release = func nil;
27       var space = func(state, mod) {
28           if (!state) {
29               space_release();
30               return space_release = func nil;
31           }
32           if (mod == 0 or mod == 1) {
33               controls.ptt(mod + 1);
34               space_release = func controls.ptt(0);
35           }
36       }
37
38       ## uncomment this line to get keycode reports printed to the terminal window
39       #setlistener("devices/status/keyboard/event", func(n) debug.dump(n.getValues()));
40   </script>
41  </nasal>
42
43  <key n="1">
44   <name>Ctrl-A</name>
45   <desc>Toggle autopilot altitude lock</desc>
46   <binding>
47    <command>nasal</command>
48    <script>
49      var node = props.globals.getNode("/autopilot/locks/altitude", 1);
50      if ( node.getValue() == "altitude-hold" ) {
51        node.setValue( "" );
52      } else {
53        node.setValue( "altitude-hold" );
54      }
55    </script>
56   </binding>
57  </key>
58
59  <key n="2">
60   <name>Ctrl-B</name>
61   <desc>Toggle speedbrake</desc>
62   <binding>
63    <command>property-toggle</command>
64    <property>/controls/flight/speedbrake</property>
65   </binding>
66  </key>
67
68  <key n="3">
69   <name>Ctrl-C</name>
70   <desc>Toggle clickable panel hotspots</desc>
71   <binding>
72    <command>property-toggle</command>
73    <property>/sim/panel-hotspots</property>
74   </binding>
75  </key>
76
77  <key n="7">
78   <name>Ctrl-G</name>
79   <desc>Toggle autopilot glide slope lock</desc>
80   <binding>
81    <command>nasal</command>
82    <script>
83      var node = props.globals.getNode("/autopilot/locks/altitude", 1);
84      if ( node.getValue() == "gs1-hold" ) {
85        node.setValue( "" );
86      } else {
87        node.setValue( "gs1-hold" );
88      }
89    </script>
90   </binding>
91  </key>
92
93  <key n="8">
94   <name>Ctrl-H</name>
95   <desc>Toggle autopilot heading lock</desc>
96   <binding>
97    <command>nasal</command>
98    <script>
99      var node = props.globals.getNode("/autopilot/locks/heading", 1);
100      if ( node.getValue() == "dg-heading-hold" ) {
101        node.setValue( "" );
102      } else {
103        node.setValue( "dg-heading-hold" );
104      }
105    </script>
106   </binding>
107  </key>
108
109  <!-- Tab key, also Ctrl-I, bit odd -->
110  <key n="9">
111         <name>Tab</name>
112         <desc>Cycle mouse mode</desc>
113         <binding>
114     
115         <condition>
116             <not><property>/devices/status/keyboard/alt</property></not>
117             <not><property>/devices/status/keyboard/ctrl</property></not>
118         </condition>
119                 <command>cycle-mouse-mode</command>
120                 <reason>key-press</reason>
121         </binding>
122  </key>
123
124  <key n="10"> <!-- OSG -->
125   <name>Enter</name>
126   <desc>Move rudder right</desc>
127   <repeatable type="bool">true</repeatable>
128   <binding>
129    <command>property-adjust</command>
130    <property>/controls/flight/rudder</property>
131    <step type="double">0.05</step>
132   </binding>
133   
134   <!-- Ctrl-M generates Enter, but we want to show the map in that case -->
135   <mod-ctrl>
136       <binding>
137         <command>dialog-show</command>
138         <dialog-name>map</dialog-name>
139       </binding>
140   </mod-ctrl>
141  </key>
142
143  <key n="13"> <!-- PLIB -->
144   <name>Enter</name>
145   <desc>Move rudder right</desc>
146   <repeatable type="bool">true</repeatable>
147   <binding>
148    <command>property-adjust</command>
149    <property>/controls/flight/rudder</property>
150    <step type="double">0.05</step>
151   </binding>
152  </key>
153
154  <key n="14">
155   <name>Ctrl-N</name>
156   <desc>Toggle autopilot nav1 lock</desc>
157   <binding>
158    <command>nasal</command>
159    <script>
160      var node = props.globals.getNode("/autopilot/locks/heading", 1);
161      if ( node.getValue() == "nav1-hold" ) {
162        node.setValue( "" );
163      } else {
164        node.setValue( "nav1-hold" );
165      }
166    </script>
167   </binding>
168  </key>
169
170  <key n="16">
171   <name>Ctrl-P</name>
172   <desc>Toggle pitch hold</desc>
173   <binding>
174    <command>nasal</command>
175    <script>
176      var node = props.globals.getNode("/autopilot/locks/altitude", 1);
177      if ( node.getValue() == "pitch-hold" ) {
178        node.setValue( "" );
179      } else {
180        node.setValue( "pitch-hold" );
181        var pitch = props.globals.getNode("/autopilot/settings/target-pitch-deg", 1);
182        pitch.setValue( getprop("/orientation/pitch-deg") );
183      }
184    </script>
185   </binding>
186  </key>
187
188  <key n="18">
189   <name>Ctrl-R</name>
190   <desc>Activate the instant replay system</desc>
191   <binding>
192    <command>replay</command>
193   </binding>
194   <binding>
195         <command>dialog-show</command>
196         <dialog-name>replay</dialog-name>
197   </binding>
198  </key>
199
200  <key n="19">
201   <name>Ctrl-S</name>
202   <desc>Toggle auto-throttle lock</desc>
203   <binding>
204    <command>nasal</command>
205    <script>
206      var node = props.globals.getNode("/autopilot/locks/speed", 1);
207      if ( node.getValue() == "speed-with-throttle" ) {
208        node.setValue( "" );
209      } else {
210        node.setValue( "speed-with-throttle" );
211      }
212    </script>
213   </binding>
214  </key>
215
216  <key n="20">
217   <name>Ctrl-T</name>
218   <desc>Toggle autopilot terrain lock</desc>
219   <binding>
220    <command>nasal</command>
221    <script>
222      var node = props.globals.getNode("/autopilot/locks/altitude", 1);
223      if ( node.getValue() == "agl-hold" ) {
224        node.setValue( "" );
225      } else {
226        node.setValue( "agl-hold" );
227        var agl = props.globals.getNode("/autopilot/settings/target-agl-ft", 1);
228        agl.setValue( getprop("/position/altitude-agl-ft") );
229      }
230    </script>
231   </binding>
232  </key>
233
234  <key n="21">
235   <name>Ctrl-U</name>
236   <desc>[Cheat] Add 1000ft of emergency altitude</desc>
237   <binding>
238    <command>property-adjust</command>
239    <property>/position/altitude-ft</property>
240    <step type="double">1000.0</step>
241   </binding>
242   <binding>
243    <command>property-assign</command>
244    <property>/sim/startup/onground</property>
245    <value type="bool">false</value>
246   </binding>
247  </key>
248
249  <key n="22">
250   <name>Ctrl-V</name>
251   <desc>Select initial view (view 0)</desc>
252   <binding>
253    <command>property-assign</command>
254    <property>/sim/current-view/view-number</property>
255    <value>0</value>
256   </binding>
257  </key>
258
259  <key n="23">
260   <name>Ctrl-W</name>
261   <desc>Toggle autopilot wing leveler</desc>
262   <binding>
263    <command>nasal</command>
264    <script>
265      var node = props.globals.getNode("/autopilot/locks/heading", 1);
266      if ( node.getValue() == "wing-leveler" ) {
267        node.setValue( "" );
268      } else {
269        node.setValue( "wing-leveler" );
270      }
271    </script>
272   </binding>
273  </key>
274
275  <key n="24">
276   <name>Ctrl-X</name>
277   <desc>Reset zoom to default</desc>
278   <binding>
279    <command>property-assign</command>
280    <property>/sim/current-view/field-of-view</property>
281    <property>/sim/view/config/default-field-of-view-deg</property>
282   </binding>
283  </key>
284
285   <key n="26">
286     <name>Ctrl-Z</name>
287     <desc>Reset visibility to default</desc>
288     <binding>
289       <command>nasal</command>
290       <script>environment.resetVisibility()</script>
291     </binding>
292   </key>
293
294   <key n="27">
295   <name>ESC</name>
296   <desc>Prompt and quit FlightGear</desc>
297   <binding>
298     <condition>
299      <not>
300       <property>/sim/freeze/replay-state</property>
301      </not>
302     </condition>
303     <command>dialog-show</command>
304     <dialog-name>exit</dialog-name>
305   </binding>
306   <binding>
307     <condition>
308       <property>/sim/freeze/replay-state</property>
309     </condition>
310     <command>property-assign</command>
311     <property>/sim/replay/disable</property>
312     <value type="bool">true</value>
313   </binding>
314   <mod-shift>
315    <desc>Reset FlightGear</desc>
316    <binding>
317     <command>reset</command>
318    </binding>
319   </mod-shift>
320  </key>
321
322  <key n="32">
323   <name>SPACE</name>
324   <desc>PTT - Push To Talk (via FGCom)</desc>
325   <binding>
326    <command>nasal</command>
327    <script>space(1, modifiers.getValue())</script>
328   </binding>
329   <mod-up>
330    <binding>
331     <command>nasal</command>
332     <script>space(0, modifiers.getValue())</script>
333    </binding>
334   </mod-up>
335   <mod-shift>
336    <binding>
337     <command>nasal</command>
338     <script>space(1, modifiers.getValue())</script>
339    </binding>
340    <mod-up>
341     <binding>
342      <command>nasal</command>
343      <script>space(0, modifiers.getValue())</script>
344     </binding>
345    </mod-up>
346   </mod-shift>
347  </key>
348
349  <key n="33">
350   <name>!</name>
351   <desc>Select first engine</desc>
352   <binding>
353    <command>nasal</command>
354    <script>controls.selectEngine(0)</script>
355   </binding>
356  </key>
357
358  <key n="35">
359   <name>#</name>
360   <desc>Select third engine</desc>
361   <binding>
362    <command>nasal</command>
363    <script>controls.selectEngine(2)</script>
364   </binding>
365  </key>
366
367  <key n="36">
368   <name>$</name>
369   <desc>Select fourth engine</desc>
370   <binding>
371    <command>nasal</command>
372    <script>controls.selectEngine(3)</script>
373   </binding>
374  </key>
375
376  <key n="39">
377   <name>'</name>
378   <desc>Display a dialog relevant to the tuned in ATC service (if any)</desc>
379   <binding>
380     <!-- At the moment, we have no working interactive ATC, so this is
381          disabled for v2.2.0. -->
382     <command>ATC-dialog</command>
383   </binding>
384  </key>
385
386  <key n="43">
387   <name>+</name>
388   <desc>Let ATC/instructor repeat last message</desc>
389   <binding>
390     <command>nasal</command>
391     <script>screen.msg_repeat()</script>
392   </binding>
393  </key>
394
395  <key n="44">
396   <name>,</name>
397   <desc>Left brake</desc>
398   <binding>
399    <command>nasal</command>
400    <script>controls.applyBrakes(1, -1)</script>
401   </binding>
402   <mod-up>
403    <binding>
404     <command>nasal</command>
405     <script>controls.applyBrakes(0, -1)</script>
406    </binding>
407   </mod-up>
408  </key>
409
410  <key n="45">
411   <name>-</name>
412   <repeatable type="bool">false</repeatable>
413   <desc>Chat Menu</desc>
414   <binding>
415      <command>dialog-show</command>
416      <dialog-name>chat-menu</dialog-name>
417   </binding>
418  </key>
419
420  <key n="46">
421   <name>.</name>
422   <desc>Right brake</desc>
423   <binding>
424    <command>nasal</command>
425    <script>controls.applyBrakes(1, 1)</script>
426   </binding>
427   <mod-up>
428    <binding>
429     <command>nasal</command>
430     <script>controls.applyBrakes(0, 1)</script>
431    </binding>
432   </mod-up>
433  </key>
434
435  <key n="47">
436   <name>/</name>
437   <desc>Open property browser</desc>
438   <binding>
439    <condition>
440     <not>
441      <property>/sim/input/property-key-handler</property>
442     </not>
443    </condition>
444    <command>nasal</command>
445    <script>gui.property_browser()</script>
446   </binding>
447   <binding>
448    <condition>
449     <property>/sim/input/property-key-handler</property>
450    </condition>
451    <command>nasal</command>
452    <script>prop_key_handler.start()</script>
453   </binding>
454  </key>
455
456  <key n="48">
457   <name>0</name>
458   <desc>Move rudder left</desc>
459   <repeatable type="bool">true</repeatable>
460   <binding>
461    <command>property-adjust</command>
462    <property>/controls/flight/rudder</property>
463    <step type="double">-0.05</step>
464   </binding>
465  </key>
466
467  <key n="49">
468   <name>1</name>
469   <desc>Decrease elevator trim</desc>
470   <repeatable type="bool">true</repeatable>
471   <binding>
472    <command>property-adjust</command>
473    <property>/controls/flight/elevator-trim</property>
474    <step type="double">-0.001</step>
475   </binding>
476   <mod-shift>
477     <desc>Look back left</desc>
478     <binding>
479      <command>property-assign</command>
480      <property>/sim/current-view/goal-heading-offset-deg</property>
481      <property>/sim/view/config/back-left-direction-deg</property>
482     </binding>
483   </mod-shift>
484  </key>
485
486  <key n="50">
487   <name>2</name>
488   <desc>Elevator up or increase autopilot altitude</desc>
489   <repeatable type="bool">true</repeatable>
490   <binding>
491    <command>nasal</command>
492    <script>
493      controls.incElevator(-0.05, 100)
494    </script>
495   </binding>
496   <mod-shift>
497    <desc>Look back</desc>
498    <binding>
499     <command>property-assign</command>
500     <property>/sim/current-view/goal-heading-offset-deg</property>
501     <property>/sim/view/config/back-direction-deg</property>
502    </binding>
503   </mod-shift>
504  </key>
505
506  <key n="51">
507   <name>3</name>
508   <desc>Decrease throttle or autopilot autothrottle</desc>
509   <repeatable type="bool">true</repeatable>
510   <binding>
511    <command>nasal</command>
512    <script>
513      controls.incThrottle(-0.01, -1.0)
514    </script>
515   </binding>
516   <mod-shift>
517    <desc>Look back right</desc>
518    <binding>
519     <command>property-assign</command>
520     <property>/sim/current-view/goal-heading-offset-deg</property>
521     <property>/sim/view/config/back-right-direction-deg</property>
522    </binding>
523   </mod-shift>
524  </key>
525
526  <key n="52">
527   <name>4</name>
528   <desc>Move aileron left (or adjust AP heading.)</desc>
529   <repeatable type="bool">true</repeatable>
530   <binding>
531    <command>nasal</command>
532    <script>
533      controls.incAileron(-0.05, -1.0)
534    </script>
535   </binding>
536   <mod-shift>
537    <desc>Look left</desc>
538    <binding>
539     <command>property-assign</command>
540     <property>/sim/current-view/goal-heading-offset-deg</property>
541     <property>/sim/view/config/left-direction-deg</property>
542    </binding>
543   </mod-shift>
544  </key>
545
546  <key n="53">
547   <name>5</name>
548   <desc>Center aileron, elevator, and rudder</desc>
549   <binding>
550    <command>nasal</command>
551    <script>controls.centerFlightControls()</script>
552   </binding>
553  </key>
554
555  <key n="54">
556   <name>6</name>
557   <desc>Move aileron right (or adjust AP heading.)</desc>
558   <repeatable type="bool">true</repeatable>
559   <binding>
560    <command>nasal</command>
561    <script>
562      controls.incAileron(0.05, 1.0)
563    </script>
564   </binding>
565   <mod-shift>
566    <desc>Look right</desc>
567    <binding>
568     <command>property-assign</command>
569     <property>/sim/current-view/goal-heading-offset-deg</property>
570     <property>/sim/view/config/right-direction-deg</property>
571    </binding>
572   </mod-shift>
573  </key>
574
575  <key n="55">
576   <name>7</name>
577   <desc>Increase elevator trim</desc>
578   <repeatable type="bool">true</repeatable>
579   <binding>
580    <command>property-adjust</command>
581    <property>/controls/flight/elevator-trim</property>
582    <step type="double">0.001</step>
583   </binding>
584   <mod-shift>
585    <desc>Look front left</desc>
586    <binding>
587     <command>property-assign</command>
588     <property>/sim/current-view/goal-heading-offset-deg</property>
589     <property>/sim/view/config/front-left-direction-deg</property>
590    </binding>
591   </mod-shift>
592  </key>
593
594  <key n="56">
595   <name>8</name>
596   <desc>Elevator down or decrease autopilot altitude</desc>
597   <repeatable type="bool">true</repeatable>
598   <binding>
599    <command>nasal</command>
600    <script>
601      controls.incElevator(0.05, -100)
602    </script>
603   </binding>
604   <mod-shift>
605    <desc>Look forward</desc>
606    <binding>
607     <command>property-assign</command>
608     <property>/sim/current-view/goal-heading-offset-deg</property>
609     <property>/sim/view/config/front-direction-deg</property>
610    </binding>
611   </mod-shift>
612  </key>
613
614  <key n="57">
615   <name>9</name>
616   <desc>Increase throttle or autopilot autothrottle</desc>
617   <repeatable type="bool">true</repeatable>
618   <binding>
619   <command>nasal</command>
620    <script>
621      controls.incThrottle(0.01, 1.0)
622    </script>
623   </binding>
624   <mod-shift>
625    <desc>Look front right</desc>
626    <binding>
627     <command>property-assign</command>
628     <property>/sim/current-view/goal-heading-offset-deg</property>
629     <property>/sim/view/config/front-right-direction-deg</property>
630    </binding>
631   </mod-shift>
632  </key>
633
634  <key n="58">
635   <name>:</name>
636   <desc>Start multikey command</desc>
637   <binding>
638    <command>nasal</command>
639    <script>multikey.start()</script>
640   </binding>
641  </key>
642
643  <key n="63">
644   <name>?</name>
645   <desc>Show help dialog</desc>
646   <binding>
647    <command>nasal</command>
648    <script>gui.showHelpDialog("/sim/help", 1)</script>
649   </binding>
650  </key>
651
652  <key n="64">
653   <name>@</name>
654   <desc>Select second engine</desc>
655   <binding>
656    <command>nasal</command>
657    <script>controls.selectEngine(1)</script>
658   </binding>
659  </key>
660
661  <key n="65">
662   <name>A</name>
663   <desc>Decrease speed-up</desc>
664         <binding>
665                 <command>nasal</command>
666                 <script>controls.speedup(-1);</script>
667         </binding>
668  </key>
669
670  <key n="66">
671   <name>B</name>
672   <desc>Toggle parking brake on or off</desc>
673   <binding>
674    <command>nasal</command>
675    <script>controls.applyParkingBrake(1)</script>
676   </binding>
677   <mod-up>
678    <binding>
679     <command>nasal</command>
680     <script>controls.applyParkingBrake(0)</script>
681    </binding>
682   </mod-up>
683  </key>
684
685  <key n="71">
686   <name>G</name>
687   <desc>Gear down</desc>
688   <binding>
689    <command>nasal</command>
690    <script>controls.gearDown(1)</script>
691   </binding>
692   <mod-up>
693    <binding>
694     <command>nasal</command>
695     <script>controls.gearDown(0)</script>
696    </binding>
697   </mod-up>
698  </key>
699
700  <key n="72">
701   <name>H</name>
702   <desc>Cycle HUD Brightness</desc>
703   <binding>
704    <command>nasal</command>
705    <script>aircraft.HUD.cycle_brightness()</script>
706   </binding>
707  </key>
708
709  <key n="73">
710   <name>I</name>
711   <desc>Switch to and toggle alternative HUD types</desc>
712   <binding>
713    <command>nasal</command>
714    <script>aircraft.HUD.cycle_type()</script>
715   </binding>
716  </key> 
717
718  <key n="77">
719   <name>M</name>
720   <desc>Mixture leaner</desc>
721   <repeatable type="bool">true</repeatable>
722   <binding>
723    <command>nasal</command>
724    <script>controls.adjMixture(-1)</script>
725   </binding>
726  </key>
727
728  <key n="78">
729   <name>N</name>
730   <desc>Propeller Coarser</desc>
731   <repeatable type="bool">true</repeatable>
732   <binding>
733    <command>nasal</command>
734    <script>controls.adjPropeller(-1)</script>
735   </binding>
736  </key>
737
738  <key n="80">
739   <name>P</name>
740   <desc>Toggle panel</desc>
741   <binding>
742    <command>property-toggle</command>
743    <property>/sim/panel/visibility</property>
744   </binding>
745  </key>
746
747  <key n="83">
748   <name>S</name>
749   <desc>Swap panels</desc>
750   <binding>
751    <condition>
752      <not>
753      <property>/sim/allow-toggle-cockpit</property>
754      </not>
755    </condition>
756    <command>property-swap</command>
757    <property>/sim/panel/path</property>
758    <property>/sim/panel_2/path</property>
759   </binding>
760   <binding>
761    <condition>
762      <not>
763      <property>/sim/allow-toggle-cockpit</property>
764      </not>
765    </condition>
766    <command>panel-load</command>
767   </binding>
768  </key>
769
770  <key n="84">
771   <name>T</name>
772   <desc>Decrease warp delta</desc>
773   <binding>
774    <command>property-adjust</command>
775    <property>/sim/time/warp-delta</property>
776    <step type="int">-30</step>
777   </binding>
778  </key>
779
780  <key n="86">
781   <name>V</name>
782   <desc>Scroll in reverse through views</desc>
783   <binding>
784    <command>nasal</command>
785    <script>view.stepView(-1)</script>
786   </binding>
787  </key>
788
789  <key n="87">
790   <name>W</name>
791   <desc>Decrease warp</desc>
792   <binding>
793    <command>property-adjust</command>
794    <property>/sim/time/warp</property>
795    <step type="int">-60</step>
796   </binding>
797  </key>
798
799  <key n="88">
800   <name>X</name>
801   <desc>Increase field of view</desc>
802   <repeatable type="bool">true</repeatable>
803   <binding>
804    <command>nasal</command>
805    <script>view.increase()</script>
806   </binding>
807  </key>
808
809  <key n="90">
810   <name>Z</name>
811   <desc>Decrease Visibility</desc>
812   <repeatable type="bool">true</repeatable>
813   <binding>
814    <command>nasal</command>
815    <script>environment.decreaseVisibility()</script>
816   </binding>
817  </key>
818
819  <key n="91">
820   <name>[</name>
821   <desc>Decrease flaps</desc>
822   <binding>
823    <command>nasal</command>
824    <script>controls.flapsDown(-1)</script>
825   </binding>
826   <mod-up>
827    <binding>
828     <command>nasal</command>
829     <script>controls.flapsDown(0)</script>
830    </binding>
831   </mod-up>
832  </key>
833
834  <key n="93">
835   <name>]</name>
836   <desc>Increase flaps</desc>
837   <binding>
838    <command>nasal</command>
839    <script>controls.flapsDown(1)</script>
840   </binding>
841   <mod-up>
842    <binding>
843     <command>nasal</command>
844     <script>controls.flapsDown(0)</script>
845    </binding>
846   </mod-up>
847  </key>
848
849  <key n="95">
850   <name>_</name>
851   <repeatable type="bool">false</repeatable>
852   <desc>Compose Chat</desc>
853   <binding>
854     <command>nasal</command>
855     <script>multiplayer.compose_message()</script>
856   </binding>
857  </key>
858
859  <key n="97">
860   <name>a</name>
861   <desc>Increase speed-up</desc>
862         <binding>
863                 <command>nasal</command>
864                 <script>controls.speedup(1);</script>
865         </binding>
866  </key>
867
868  <key n="98">
869   <name>b</name>
870   <desc>Apply all brakes</desc>
871   <binding>
872    <command>nasal</command>
873    <script>controls.applyBrakes(1)</script>
874   </binding>
875   <mod-up>
876    <binding>
877     <command>nasal</command>
878     <script>controls.applyBrakes(0)</script>
879    </binding>
880   </mod-up>
881  </key>
882
883  <key n="99">
884   <name>c</name>
885   <desc>Toggle 3D/2D cockpit</desc>
886   <binding>
887    <command>nasal</command>
888    <script>
889     if(getprop("/sim/allow-toggle-cockpit")) {
890         setprop("/sim/current-view/internal", !getprop("/sim/current-view/internal"));
891         setprop("/sim/view/internal", getprop("/sim/current-view/internal"));
892         setprop("/sim/virtual-cockpit", !getprop("/sim/virtual-cockpit"));
893         if(getprop("/sim/current-view/internal")) {
894           setprop("/sim/current-view/heading-offset-deg", getprop("/sim/current-view/config/heading-offset-deg"));
895           setprop("/sim/current-view/pitch-offset-deg", getprop("/sim/current-view/config/pitch-offset-deg"));
896         } else {
897           setprop("/sim/current-view/heading-offset-deg", 0);
898           setprop("/sim/current-view/pitch-offset-deg", 0);
899         }
900     }
901    </script>
902   </binding>
903  </key>
904
905  <key n="103">
906   <name>g</name>
907   <desc>Gear Up</desc>
908   <binding>
909    <command>nasal</command>
910    <script>controls.gearDown(-1)</script>
911   </binding>
912   <mod-up>
913    <binding>
914     <command>nasal</command>
915     <script>controls.gearDown(0)</script>
916    </binding>
917   </mod-up>
918  </key>
919
920  <key n="104">
921   <name>h</name>
922   <desc>HUD Master Switch</desc>
923   <binding>
924    <command>nasal</command>
925    <script>aircraft.HUD.cycle_color()</script>
926   </binding>
927  </key>
928
929  <key n="105">
930   <name>i</name>
931   <desc>Normal HUD</desc>
932   <binding>
933    <command>nasal</command>
934    <script>aircraft.HUD.normal_type()</script>
935   </binding>
936  </key>
937
938  <key n="106">
939   <name>j</name>
940   <desc>Decrease spoilers</desc>
941   <binding>
942    <command>nasal</command>
943    <script>controls.stepSpoilers(-1)</script>
944   </binding>
945  </key>
946
947  <key n="107">
948   <name>k</name>
949   <desc>Increase spoilers</desc>
950   <binding>
951    <command>nasal</command>
952    <script>controls.stepSpoilers(1)</script>
953   </binding>
954  </key>
955
956  <key n="108">
957   <name>l</name>
958   <desc>Toggle tail-wheel lock</desc>
959   <binding>
960    <command>property-toggle</command>
961    <property>/controls/gear/tailwheel-lock</property>
962   </binding>
963  </key>
964
965  <key n="109">
966   <name>m</name>
967   <desc>Mixture richer</desc>
968   <repeatable type="bool">true</repeatable>
969   <binding>
970    <command>nasal</command>
971    <script>controls.adjMixture(1)</script>
972   </binding>
973  </key>
974
975  <key n="110">
976   <name>n</name>
977   <desc>Propeller Finer</desc>
978   <repeatable type="bool">true</repeatable>
979   <binding>
980    <command>nasal</command>
981    <script>controls.adjPropeller(1)</script>
982   </binding>
983  </key>
984
985  <key n="112">
986   <name>p</name>
987   <desc>Toggle the pause state of the sim</desc>
988   <binding>
989    <command>pause</command>
990   </binding>
991  </key>
992
993  <key n="115">
994   <name>s</name>
995   <desc>Fire Starter on Selected Engine(s)</desc>
996   <binding>
997    <command>nasal</command>
998    <script>controls.startEngine(1)</script>
999   </binding>
1000   <mod-up>
1001    <binding>
1002     <command>nasal</command>
1003     <script>controls.startEngine(0)</script>
1004    </binding>
1005   </mod-up>
1006  </key>
1007
1008  <nasal>
1009   <script>
1010     var t_id = 0;
1011   </script>
1012  </nasal>
1013
1014  <key n="116">
1015   <name>t</name>
1016   <desc>Increase warp delta</desc>
1017   <binding>
1018    <command>property-adjust</command>
1019    <property>/sim/time/warp-delta</property>
1020    <step type="int">30</step>
1021   </binding>
1022   <binding>
1023    <command>nasal</command>
1024    <script>
1025     (func(x) {
1026         settimer(func {
1027             x == t_id or return;
1028             gui.popupTip("resetting warp");
1029             setprop("/sim/time/warp-delta", 0);
1030         }, 1, 1)
1031     })(t_id += 1)
1032    </script>
1033   </binding>
1034   <mod-up>
1035    <binding>
1036     <command>nasal</command>
1037     <script>t_id += 1</script>
1038    </binding>
1039   </mod-up>
1040  </key>
1041
1042  <key n="118">
1043   <name>v</name>
1044   <desc>Scroll through views</desc>
1045   <binding>
1046    <command>nasal</command>
1047    <script>view.stepView(1)</script>
1048   </binding>
1049  </key>
1050
1051  <key n="119">
1052   <name>w</name>
1053   <desc>Increase warp</desc>
1054   <binding>
1055    <command>property-adjust</command>
1056    <property>/sim/time/warp</property>
1057    <step type="int">60</step>
1058   </binding>
1059  </key>
1060
1061  <key n="120">
1062   <name>x</name>
1063   <desc>Decrease field of view</desc>
1064   <repeatable type="bool">true</repeatable>
1065   <binding>
1066    <command>nasal</command>
1067    <script>view.decrease()</script>
1068   </binding>
1069  </key>
1070
1071  <key n="122">
1072   <name>z</name>
1073   <desc>Increase Visibility</desc>
1074   <repeatable type="bool">true</repeatable>
1075    <binding>
1076    <command>nasal</command>
1077    <script>environment.increaseVisibility()</script>
1078   </binding>
1079  </key>
1080
1081  <key n="123">
1082   <name>{</name>
1083   <desc>Decrease Magneto on Selected Engine</desc>
1084   <binding>
1085    <command>nasal</command>
1086    <script>controls.stepMagnetos(-1)</script>
1087   </binding>
1088   <mod-up>
1089    <binding>
1090     <command>nasal</command>
1091     <script>controls.stepMagnetos(0)</script>
1092    </binding>
1093   </mod-up>
1094  </key>
1095
1096  <key n="125">
1097   <name>}</name>
1098   <desc>Increase Magneto on Selected Engine</desc>
1099   <binding>
1100    <command>nasal</command>
1101    <script>controls.stepMagnetos(1)</script>
1102   </binding>
1103   <mod-up>
1104    <binding>
1105     <command>nasal</command>
1106     <script>controls.stepMagnetos(0)</script>
1107    </binding>
1108   </mod-up>
1109  </key>
1110
1111  <key n="126">
1112   <name>~</name>
1113   <desc>Select all engines</desc>
1114   <binding>
1115    <command>nasal</command>
1116    <script>controls.selectAllEngines()</script>
1117   </binding>
1118  </key>
1119
1120  <key n="257">
1121   <name>F1</name>
1122   <mod-shift>
1123    <desc>Load flight recorder tape</desc>
1124    <binding>
1125     <command>dialog-show</command>
1126     <dialog-name>flight-recorder-load</dialog-name>
1127    </binding>
1128   </mod-shift>
1129  </key>
1130
1131  <key n="258">
1132   <name>F2</name>
1133   <mod-shift>
1134    <desc>Save flight recorder tape</desc>
1135    <binding>
1136     <command>dialog-show</command>
1137     <dialog-name>flight-recorder-save</dialog-name>
1138    </binding>
1139   </mod-shift>
1140  </key>
1141
1142  <key n="259">
1143   <name>F3</name>
1144   <desc>Capture screen</desc>
1145   <binding>
1146    <command>screen-capture</command>
1147   </binding>
1148   <mod-shift>
1149    <desc>Load panel</desc>
1150    <binding>
1151     <command>panel-load</command>
1152    </binding>
1153   </mod-shift>
1154  </key>
1155
1156  <key n="261">
1157   <name>F5</name>
1158   <repeatable type="bool">true</repeatable>
1159   <mod-shift>
1160    <desc>Scroll panel down</desc>
1161    <binding>
1162     <command>property-adjust</command>
1163     <property>/sim/panel/y-offset</property>
1164     <step type="int">-5</step>
1165    </binding>
1166   </mod-shift>
1167  </key>
1168
1169  <key n="262">
1170   <name>F6</name>
1171   <desc>Toggle Autopilot Heading Mode</desc>
1172   <repeatable type="bool">true</repeatable>
1173   <binding>
1174    <command>nasal</command>
1175    <script>
1176     var prop = "/autopilot/locks/heading";
1177     var curr = getprop(prop);
1178     if(curr == "true-heading-hold") { setprop(prop, ""); }
1179     else { setprop(prop, "true-heading-hold"); }
1180    </script>
1181   </binding>
1182   <mod-shift>
1183    <desc>Scroll panel up</desc>
1184    <binding>
1185     <command>property-adjust</command>
1186     <property>/sim/panel/y-offset</property>
1187     <step type="int">5</step>
1188    </binding>
1189   </mod-shift>
1190  </key>
1191
1192  <key n="263">
1193   <name>F7</name>
1194   <repeatable type="bool">true</repeatable>
1195   <mod-shift>
1196    <desc>Scroll panel left</desc>
1197    <binding>
1198     <command>property-adjust</command>
1199     <property>/sim/panel/x-offset</property>
1200     <step type="int">-5</step>
1201    </binding>
1202   </mod-shift>
1203  </key>
1204
1205  <key n="264">
1206   <name>F8</name>
1207   <desc></desc>
1208   <repeatable type="bool">true</repeatable>
1209   <mod-shift>
1210    <desc>Scroll panel right</desc>
1211    <binding>
1212     <command>property-adjust</command>
1213     <property>/sim/panel/x-offset</property>
1214     <step type="int">5</step>
1215    </binding>
1216   </mod-shift>
1217  </key>
1218
1219  <key n="266">
1220   <name>F10</name>
1221   <desc>Toggle menubar</desc>
1222   <binding>
1223    <command>property-toggle</command>
1224    <property>/sim/menubar/visibility</property>
1225   </binding>
1226   <mod-shift>
1227     <desc>Toggle fullscreen</desc>
1228     <binding>
1229       <command>toggle-fullscreen</command>
1230     </binding>
1231 <!--
1232    <desc>Switch to next GUI style</desc>
1233    <binding>
1234     <command>nasal</command>
1235     <script>gui.nextStyle()</script>
1236    </binding>
1237 -->
1238   </mod-shift>
1239  </key>
1240
1241  <key n="267">
1242   <name>F11</name>
1243   <desc>Pop up autopilot dialog</desc>
1244   <binding>
1245    <command>dialog-show</command>
1246    <dialog-name>autopilot</dialog-name>
1247   </binding>
1248  </key>
1249
1250  <key n="268">
1251   <name>F12</name>
1252   <desc>Pop up radio settings dialog</desc>
1253   <binding>
1254    <command>dialog-show</command>
1255    <dialog-name>radios</dialog-name>
1256   </binding>
1257  </key>
1258
1259  <key n="269">
1260   <name>Enter</name>
1261   <desc>Move rudder right</desc>
1262   <repeatable type="bool">true</repeatable>
1263   <binding>
1264    <command>property-adjust</command>
1265    <property>/controls/flight/rudder</property>
1266    <step type="double">0.05</step>
1267   </binding>
1268  </key>
1269
1270  <key n="309">
1271   <name>Keypad 5</name>
1272   <desc>Center aileron, elevator, and rudder</desc>
1273   <binding>
1274    <command>nasal</command>
1275    <script>controls.centerFlightControls()</script>
1276   </binding>
1277  </key>
1278
1279  <key n="356">
1280   <name>Left</name>
1281   <desc>Move aileron left (or adjust AP heading.)</desc>
1282   <repeatable type="bool">true</repeatable>
1283   <binding>
1284    <command>nasal</command>
1285    <script>
1286      if (getprop("/sim/freeze/replay-state"))
1287        controls.replaySkip(-5);
1288      else
1289        controls.incAileron(-0.05, -1.0)
1290    </script>
1291   </binding>
1292   <mod-shift>
1293    <desc>Look left</desc>
1294    <binding>
1295     <command>property-assign</command>
1296     <property>/sim/current-view/goal-heading-offset-deg</property>
1297     <property>/sim/view/config/left-direction-deg</property>
1298    </binding>
1299   </mod-shift>
1300  </key>
1301
1302  <key n="357">
1303   <name>Up</name>
1304   <desc>Elevator down or decrease autopilot altitude</desc>
1305   <repeatable type="bool">true</repeatable>
1306   <binding>
1307    <command>nasal</command>
1308    <script>
1309      if (getprop("/sim/freeze/replay-state"))
1310        controls.speedup(1);
1311      else
1312        controls.incElevator(0.05, -100)
1313    </script>
1314   </binding>
1315   <mod-shift>
1316    <desc>Look forward</desc>
1317    <binding>
1318     <command>property-assign</command>
1319     <property>/sim/current-view/goal-heading-offset-deg</property>
1320     <property>/sim/view/config/front-direction-deg</property>
1321    </binding>
1322   </mod-shift>
1323  </key>
1324
1325  <key n="358">
1326   <name>Right</name>
1327   <desc>Move aileron right (or adjust AP heading.)</desc>
1328   <repeatable type="bool">true</repeatable>
1329   <binding>
1330    <command>nasal</command>
1331    <script>
1332      if (getprop("/sim/freeze/replay-state"))
1333        controls.replaySkip(5);
1334      else
1335        controls.incAileron(0.05, 1.0)
1336    </script>
1337    <step type="double">0.05</step>
1338   </binding>
1339   <mod-shift>
1340    <desc>Look right</desc>
1341    <binding>
1342     <command>property-assign</command>
1343     <property>/sim/current-view/goal-heading-offset-deg</property>
1344     <property>/sim/view/config/right-direction-deg</property>
1345    </binding>
1346   </mod-shift>
1347  </key>
1348
1349  <key n="359">
1350   <name>Down</name>
1351   <desc>Elevator up or increase autopilot altitude</desc>
1352   <repeatable type="bool">true</repeatable>
1353   <binding>
1354    <command>nasal</command>
1355    <script>
1356      if (getprop("/sim/freeze/replay-state"))
1357        controls.speedup(-1);
1358      else
1359        controls.incElevator(-0.05, 100)
1360    </script>
1361   </binding>
1362   <mod-shift>
1363    <desc>Look backwards</desc>
1364    <binding>
1365     <command>property-assign</command>
1366     <property>/sim/current-view/goal-heading-offset-deg</property>
1367     <property>/sim/view/config/back-direction-deg</property>
1368    </binding>
1369   </mod-shift>
1370  </key>
1371
1372  <key n="360">
1373   <name>PageUp</name>
1374   <desc>Increase throttle or autopilot autothrottle</desc>
1375   <repeatable type="bool">true</repeatable>
1376   <binding>
1377    <command>nasal</command>
1378    <script>
1379      controls.incThrottle(0.01, 1.0)
1380    </script>
1381   </binding>
1382   <mod-shift>
1383    <desc>Look front right</desc>
1384    <binding>
1385     <command>property-assign</command>
1386     <property>/sim/current-view/goal-heading-offset-deg</property>
1387     <property>/sim/view/config/front-right-direction-deg</property>
1388    </binding>
1389   </mod-shift>
1390  </key>
1391
1392  <key n="361">
1393   <name>PageDown</name>
1394   <desc>Decrease throttle or autopilot autothrottle</desc>
1395   <repeatable type="bool">true</repeatable>
1396   <binding>
1397    <command>nasal</command>
1398    <script>
1399      controls.incThrottle(-0.01, -1.0)
1400    </script>
1401   </binding>
1402   <mod-shift>
1403    <desc>Look back right</desc>
1404    <binding>
1405     <command>property-assign</command>
1406     <property>/sim/current-view/goal-heading-offset-deg</property>
1407     <property>/sim/view/config/back-right-direction-deg</property>
1408    </binding>
1409   </mod-shift>
1410  </key>
1411
1412  <key n="362">
1413   <name>Home</name>
1414   <desc>Increase elevator trim</desc>
1415   <repeatable type="bool">true</repeatable>
1416   <binding>
1417    <command>property-adjust</command>
1418    <property>/controls/flight/elevator-trim</property>
1419    <step type="double">0.001</step>
1420   </binding>
1421   <mod-shift>
1422    <desc>Look front left</desc>
1423    <binding>
1424     <command>property-assign</command>
1425     <property>/sim/current-view/goal-heading-offset-deg</property>
1426     <property>/sim/view/config/front-left-direction-deg</property>
1427    </binding>
1428   </mod-shift>
1429  </key>
1430
1431  <key n="363">
1432   <name>End</name>
1433   <desc>Decrease elevator trim</desc>
1434   <repeatable type="bool">true</repeatable>
1435   <binding>
1436    <command>property-adjust</command>
1437    <property>/controls/flight/elevator-trim</property>
1438    <step type="double">-0.001</step>
1439   </binding>
1440   <mod-shift>
1441    <desc>Look back left</desc>
1442    <binding>
1443     <command>property-assign</command>
1444     <property>/sim/current-view/goal-heading-offset-deg</property>
1445     <property>/sim/view/config/back-left-direction-deg</property>
1446    </binding>
1447   </mod-shift>
1448  </key>
1449
1450  <key n="364">
1451   <name>Insert</name>
1452   <desc>Move rudder left</desc>
1453   <repeatable type="bool">true</repeatable>
1454   <binding>
1455    <command>property-adjust</command>
1456    <property>/controls/flight/rudder</property>
1457    <step type="double">-0.05</step>
1458   </binding>
1459  </key>
1460
1461 </PropertyList>
1462
1463 <!-- end of keyboard.xml -->