Document command-line options.
[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</desc>
1105    <binding>
1106     <command>load</command>
1107    </binding>
1108   </mod-shift>
1109  </key>
1110
1111  <key n="258">
1112   <mod-shift>
1113    <desc>Save flight</desc>
1114    <binding>
1115     <command>save</command>
1116     <write-all>false</write-all>
1117    </binding>
1118   </mod-shift>
1119  </key>-->
1120
1121  <key n="259">
1122   <name>F3</name>
1123   <desc>Capture screen</desc>
1124   <binding>
1125    <command>screen-capture</command>
1126   </binding>
1127   <mod-shift>
1128    <desc>Load panel</desc>
1129    <binding>
1130     <command>panel-load</command>
1131    </binding>
1132   </mod-shift>
1133  </key>
1134
1135  <key n="261">
1136   <name>F5</name>
1137   <repeatable type="bool">true</repeatable>
1138   <mod-shift>
1139    <desc>Scroll panel down</desc>
1140    <binding>
1141     <command>property-adjust</command>
1142     <property>/sim/panel/y-offset</property>
1143     <step type="int">-5</step>
1144    </binding>
1145   </mod-shift>
1146  </key>
1147
1148  <key n="262">
1149   <name>F6</name>
1150   <desc>Toggle Autopilot Heading Mode</desc>
1151   <repeatable type="bool">true</repeatable>
1152   <binding>
1153    <command>nasal</command>
1154    <script>
1155     var prop = "/autopilot/locks/heading";
1156     var curr = getprop(prop);
1157     if(curr == "true-heading-hold") { setprop(prop, ""); }
1158     else { setprop(prop, "true-heading-hold"); }
1159    </script>
1160   </binding>
1161   <mod-shift>
1162    <desc>Scroll panel up</desc>
1163    <binding>
1164     <command>property-adjust</command>
1165     <property>/sim/panel/y-offset</property>
1166     <step type="int">5</step>
1167    </binding>
1168   </mod-shift>
1169  </key>
1170
1171  <key n="263">
1172   <name>F7</name>
1173   <repeatable type="bool">true</repeatable>
1174   <mod-shift>
1175    <desc>Scroll panel left</desc>
1176    <binding>
1177     <command>property-adjust</command>
1178     <property>/sim/panel/x-offset</property>
1179     <step type="int">-5</step>
1180    </binding>
1181   </mod-shift>
1182  </key>
1183
1184  <key n="264">
1185   <name>F8</name>
1186   <desc></desc>
1187   <repeatable type="bool">true</repeatable>
1188   <mod-shift>
1189    <desc>Scroll panel right</desc>
1190    <binding>
1191     <command>property-adjust</command>
1192     <property>/sim/panel/x-offset</property>
1193     <step type="int">5</step>
1194    </binding>
1195   </mod-shift>
1196  </key>
1197
1198  <key n="266">
1199   <name>F10</name>
1200   <desc>Toggle menubar</desc>
1201   <binding>
1202    <command>property-toggle</command>
1203    <property>/sim/menubar/visibility</property>
1204   </binding>
1205   <mod-shift>
1206    <desc>Switch to next GUI style</desc>
1207    <binding>
1208     <command>nasal</command>
1209     <script>gui.nextStyle()</script>
1210    </binding>
1211   </mod-shift>
1212  </key>
1213
1214  <key n="267">
1215   <name>F11</name>
1216   <desc>Pop up autopilot dialog</desc>
1217   <binding>
1218    <command>dialog-show</command>
1219    <dialog-name>autopilot</dialog-name>
1220   </binding>
1221  </key>
1222
1223  <key n="268">
1224   <name>F12</name>
1225   <desc>Pop up radio settings dialog</desc>
1226   <binding>
1227    <command>dialog-show</command>
1228    <dialog-name>radios</dialog-name>
1229   </binding>
1230  </key>
1231
1232  <key n="269">
1233   <name>Enter</name>
1234   <desc>Move rudder right</desc>
1235   <repeatable type="bool">true</repeatable>
1236   <binding>
1237    <command>property-adjust</command>
1238    <property>/controls/flight/rudder</property>
1239    <step type="double">0.05</step>
1240   </binding>
1241  </key>
1242
1243  <key n="309">
1244   <name>Keypad 5</name>
1245   <desc>Center aileron, elevator, and rudder</desc>
1246   <binding>
1247    <command>nasal</command>
1248    <script>controls.centerFlightControls()</script>
1249   </binding>
1250  </key>
1251
1252  <key n="356">
1253   <name>Left</name>
1254   <desc>Move aileron left (or adjust AP heading.)</desc>
1255   <repeatable type="bool">true</repeatable>
1256   <binding>
1257    <command>nasal</command>
1258    <script>
1259      if (getprop("/sim/freeze/replay-state"))
1260        controls.replaySkip(-5);
1261      else
1262        controls.incAileron(-0.05, -1.0)
1263    </script>
1264   </binding>
1265   <mod-shift>
1266    <desc>Look left</desc>
1267    <binding>
1268     <command>property-assign</command>
1269     <property>/sim/current-view/goal-heading-offset-deg</property>
1270     <property>/sim/view/config/left-direction-deg</property>
1271    </binding>
1272   </mod-shift>
1273  </key>
1274
1275  <key n="357">
1276   <name>Up</name>
1277   <desc>Elevator down or decrease autopilot altitude</desc>
1278   <repeatable type="bool">true</repeatable>
1279   <binding>
1280    <command>nasal</command>
1281    <script>
1282      if (getprop("/sim/freeze/replay-state"))
1283        controls.speedup(1);
1284      else
1285        controls.incElevator(0.05, -100)
1286    </script>
1287   </binding>
1288   <mod-shift>
1289    <desc>Look forward</desc>
1290    <binding>
1291     <command>property-assign</command>
1292     <property>/sim/current-view/goal-heading-offset-deg</property>
1293     <property>/sim/view/config/front-direction-deg</property>
1294    </binding>
1295   </mod-shift>
1296  </key>
1297
1298  <key n="358">
1299   <name>Right</name>
1300   <desc>Move aileron right (or adjust AP heading.)</desc>
1301   <repeatable type="bool">true</repeatable>
1302   <binding>
1303    <command>nasal</command>
1304    <script>
1305      if (getprop("/sim/freeze/replay-state"))
1306        controls.replaySkip(5);
1307      else
1308        controls.incAileron(0.05, 1.0)
1309    </script>
1310    <step type="double">0.05</step>
1311   </binding>
1312   <mod-shift>
1313    <desc>Look right</desc>
1314    <binding>
1315     <command>property-assign</command>
1316     <property>/sim/current-view/goal-heading-offset-deg</property>
1317     <property>/sim/view/config/right-direction-deg</property>
1318    </binding>
1319   </mod-shift>
1320  </key>
1321
1322  <key n="359">
1323   <name>Down</name>
1324   <desc>Elevator up or increase autopilot altitude</desc>
1325   <repeatable type="bool">true</repeatable>
1326   <binding>
1327    <command>nasal</command>
1328    <script>
1329      if (getprop("/sim/freeze/replay-state"))
1330        controls.speedup(-1);
1331      else
1332        controls.incElevator(-0.05, 100)
1333    </script>
1334   </binding>
1335   <mod-shift>
1336    <desc>Look backwards</desc>
1337    <binding>
1338     <command>property-assign</command>
1339     <property>/sim/current-view/goal-heading-offset-deg</property>
1340     <property>/sim/view/config/back-direction-deg</property>
1341    </binding>
1342   </mod-shift>
1343  </key>
1344
1345  <key n="360">
1346   <name>PageUp</name>
1347   <desc>Increase throttle or autopilot autothrottle</desc>
1348   <repeatable type="bool">true</repeatable>
1349   <binding>
1350    <command>nasal</command>
1351    <script>
1352      controls.incThrottle(0.01, 1.0)
1353    </script>
1354   </binding>
1355   <mod-shift>
1356    <desc>Look front right</desc>
1357    <binding>
1358     <command>property-assign</command>
1359     <property>/sim/current-view/goal-heading-offset-deg</property>
1360     <property>/sim/view/config/front-right-direction-deg</property>
1361    </binding>
1362   </mod-shift>
1363  </key>
1364
1365  <key n="361">
1366   <name>PageDown</name>
1367   <desc>Decrease throttle or autopilot autothrottle</desc>
1368   <repeatable type="bool">true</repeatable>
1369   <binding>
1370    <command>nasal</command>
1371    <script>
1372      controls.incThrottle(-0.01, -1.0)
1373    </script>
1374   </binding>
1375   <mod-shift>
1376    <desc>Look back right</desc>
1377    <binding>
1378     <command>property-assign</command>
1379     <property>/sim/current-view/goal-heading-offset-deg</property>
1380     <property>/sim/view/config/back-right-direction-deg</property>
1381    </binding>
1382   </mod-shift>
1383  </key>
1384
1385  <key n="362">
1386   <name>Home</name>
1387   <desc>Increase elevator trim</desc>
1388   <repeatable type="bool">true</repeatable>
1389   <binding>
1390    <command>property-adjust</command>
1391    <property>/controls/flight/elevator-trim</property>
1392    <step type="double">0.001</step>
1393   </binding>
1394   <mod-shift>
1395    <desc>Look front left</desc>
1396    <binding>
1397     <command>property-assign</command>
1398     <property>/sim/current-view/goal-heading-offset-deg</property>
1399     <property>/sim/view/config/front-left-direction-deg</property>
1400    </binding>
1401   </mod-shift>
1402  </key>
1403
1404  <key n="363">
1405   <name>End</name>
1406   <desc>Decrease elevator trim</desc>
1407   <repeatable type="bool">true</repeatable>
1408   <binding>
1409    <command>property-adjust</command>
1410    <property>/controls/flight/elevator-trim</property>
1411    <step type="double">-0.001</step>
1412   </binding>
1413   <mod-shift>
1414    <desc>Look back left</desc>
1415    <binding>
1416     <command>property-assign</command>
1417     <property>/sim/current-view/goal-heading-offset-deg</property>
1418     <property>/sim/view/config/back-left-direction-deg</property>
1419    </binding>
1420   </mod-shift>
1421  </key>
1422
1423  <key n="364">
1424   <name>Insert</name>
1425   <desc>Move rudder left</desc>
1426   <repeatable type="bool">true</repeatable>
1427   <binding>
1428    <command>property-adjust</command>
1429    <property>/controls/flight/rudder</property>
1430    <step type="double">-0.05</step>
1431   </binding>
1432  </key>
1433
1434 </PropertyList>
1435
1436 <!-- end of keyboard.xml -->