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