<?xml version="1.0"?>

<PropertyList>

   <key n="1">
    <name>Ctrl-A</name>
    <desc>Toggle autopilot altitude lock.</desc>
    <binding>
     <command>nasal</command>
     <script>globals.Boeing314.autopilotsystem.apaltitudeexport();</script>
    </binding>
   </key>

   <key n="2">
    <name>Ctrl-B</name>
    <desc>Toggle boat view.</desc>
    <binding>
     <command>nasal</command>
     <script>globals.Boeing314.seatsystem.viewexport("boat");</script>
    </binding>
   </key>

   <key n="5">
    <name>Ctrl-E</name>
    <desc>Toggle engineer/captain view</desc>
    <binding>
     <command>nasal</command>
     <script>globals.Boeing314.seatsystem.viewexport("engineer");</script>
    </binding>
   </key>

   <key n="8">
    <name>Ctrl-H</name>
    <desc>Toggle autopilot heading lock.</desc>
    <binding>
     <command>nasal</command>
     <script>globals.Boeing314.autopilotsystem.apheadingexport();</script>
    </binding>
   </key>

   <key n="9">
    <name>Ctrl-I</name>
    <desc>Menu</desc>
    <binding>
     <command>dialog-show</command>
     <dialog-name>Boeing314-menu</dialog-name>
    </binding>
   </key>

   <key n="10">
    <name>Ctrl-J</name>
    <desc>Toggle copilot view.</desc>
    <binding>
     <command>nasal</command>
     <script>globals.Boeing314.seatsystem.viewexport("copilot");</script>
    </binding>
   </key>

   <key n="11">
    <name>Ctrl-K</name>
    <desc>Toggle observer view.</desc>
    <binding>
     <command>nasal</command>
     <script>globals.Boeing314.seatsystem.viewexport("observer");</script>
    </binding>
   </key>

   <key n="15">
    <name>Ctrl-O</name>
    <desc>Toggle radio view.</desc>
    <binding>
     <command>nasal</command>
     <script>globals.Boeing314.seatsystem.viewexport("radio");</script>
    </binding>
   </key>

   <key n="16">
    <name>Ctrl-P</name>
    <desc>Toggle pitch hold.</desc>
    <binding>
     <command>nasal</command>
     <script>globals.Boeing314.autopilotsystem.appitchexport();</script>
    </binding>
   </key>

   <key n="19">
    <name>Ctrl-S</name>
    <desc>Toggle auto-throttle.</desc>
    <binding>
     <command>nasal</command>
     <script>globals.Boeing314.copilotcrew.toggleexport();</script>
    </binding>
   </key>

   <key n="20">
    <name>Ctrl-T</name>
    <desc>Toggle celestial view.</desc>
    <binding>
     <command>nasal</command>
     <script>globals.Boeing314.seatsystem.viewexport("celestial");</script>
    </binding>
    <mod-shift>
     <desc>Sextant</desc>
     <binding>
      <command>nasal</command>
      <script>globals.Boeing314.seatsystem.polarisexport();</script>
     </binding>
    </mod-shift>
   </key>

   <key n="22">
    <name>Ctrl-V</name>
    <desc>Select initial view (view 0).</desc>
    <binding>
     <command>nasal</command>
     <script>globals.Boeing314.seatsystem.viewexport("captain");</script>
    </binding>
   </key>

   <key n="24">
    <name>Ctrl-X</name>
    <mod-shift>
     <desc>Restore floating view</desc>
     <binding>
      <command>nasal</command>
      <script>globals.Boeing314.seatsystem.restoreexport();</script>
     </binding>
    </mod-shift>
   </key>

   <key n="66">
    <name>B</name>
    <desc>Toggle parking brake (anchor) on or off</desc>
    <binding>
     <condition include="../Panels/Instruments/B314-cond-rope.xml"/>
     <command>property-toggle</command>
     <property>/controls/gear/brake-parking</property>
    </binding>
   </key>

   <key n="69">
    <name>E</name>
    <desc>Decrease propeller pitch</desc>
    <repeatable type="bool">true</repeatable>
    <binding>
     <command>property-adjust</command>
     <property>/controls/engines/engine[0]/propeller-pitch</property>
     <step type="double">-0.05</step>
    </binding>
    <binding>
     <command>property-adjust</command>
     <property>/controls/engines/engine[1]/propeller-pitch</property>
     <step type="double">-0.05</step>
    </binding>
    <binding>
     <command>property-adjust</command>
     <property>/controls/engines/engine[2]/propeller-pitch</property>
     <step type="double">-0.05</step>
    </binding>
    <binding>
     <command>property-adjust</command>
     <property>/controls/engines/engine[3]/propeller-pitch</property>
     <step type="double">-0.05</step>
    </binding>
   </key>

   <key n="86">
    <name>V</name>
    <desc>Scroll in reverse through views.</desc>
    <binding>
     <command>nasal</command>
     <script>globals.Boeing314.seatsystem.scrollreverseexport();</script>
    </binding>
   </key>

   <key n="98">
    <name>b</name>
    <desc>Apply all brakes (anchor).</desc>
    <binding>
     <condition include="../Panels/Instruments/B314-cond-rope.xml"/>
     <command>property-assign</command>
     <property>/controls/gear/brake-left</property>
     <value type="double">1.0</value>
    </binding>
    <binding>
     <condition include="../Panels/Instruments/B314-cond-rope.xml"/>
     <command>property-assign</command>
     <property>/controls/gear/brake-right</property>
     <value type="double">1.0</value>
    </binding>
    <mod-up>
     <binding>
      <command>property-assign</command>
      <property>/controls/gear/brake-left</property>
      <value type="double">0.0</value>
     </binding>
     <binding>
      <command>property-assign</command>
      <property>/controls/gear/brake-right</property>
      <value type="double">0.0</value>
     </binding>
    </mod-up>
   </key>

   <key n="101">
    <name>e</name>
    <desc>Increase propeller pitch</desc>
    <repeatable type="bool">true</repeatable>
    <binding>
     <command>property-adjust</command>
     <property>/controls/engines/engine[0]/propeller-pitch</property>
     <step type="double">0.05</step>
    </binding>
    <binding>
     <command>property-adjust</command>
     <property>/controls/engines/engine[1]/propeller-pitch</property>
     <step type="double">0.05</step>
    </binding>
    <binding>
     <command>property-adjust</command>
     <property>/controls/engines/engine[2]/propeller-pitch</property>
     <step type="double">0.05</step>
    </binding>
    <binding>
     <command>property-adjust</command>
     <property>/controls/engines/engine[3]/propeller-pitch</property>
     <step type="double">0.05</step>
    </binding>
   </key>

   <key n="113">
    <name>q</name>
    <desc>reset speed-up.</desc>
    <binding>
     <command>property-assign</command>
     <property>/sim/speed-up</property>
     <value>1</value>
    </binding>
   </key>

   <key n="118">
    <name>v</name>
    <desc>Cycle view</desc>
    <desc>Scroll through views.</desc>
    <binding>
     <command>nasal</command>
     <script>globals.Boeing314.seatsystem.scrollexport();</script>
    </binding>
   </key>

   <key n="356">
    <name>Left</name>
    <desc>Move aileron left or adjust AP heading or move view left.</desc>
    <repeatable type="bool">true</repeatable>
    <binding>
     <command>nasal</command>
     <script>
       if( !globals.Boeing314.seatsystem.movewidthexport("observer", -0.01) ) {
           if( !globals.Boeing314.seatsystem.movewidthexport("celestial", -0.01) ) {
               # default
               controls.incAileron(-0.05, -1.0)
           }
       }
     </script>
    </binding>
   </key>

   <key n="357">
    <name>Up</name>
    <desc>Increase elevator or autopilot pitch or move view front.</desc>
    <repeatable type="bool">true</repeatable>
    <binding>
     <command>nasal</command>
     <script>
       if( !globals.Boeing314.seatsystem.movelengthexport("observer", -0.01) ) {
           if( !globals.Boeing314.seatsystem.movelengthexport("celestial", -0.01) ) {
               if( !globals.Boeing314.autopilotsystem.pitchexport(5.0) ) {
                   # default
                   controls.incElevator(0.05, -100);
               }
           }
       }
     </script>
    </binding>
   </key>

   <key n="358">
    <name>Right</name>
    <desc>Move aileron right or adjust AP heading or move view right.</desc>
    <repeatable type="bool">true</repeatable>
    <binding>
     <command>nasal</command>
     <script>
       if( !globals.Boeing314.seatsystem.movewidthexport("observer", 0.01) ) {
           if( !globals.Boeing314.seatsystem.movewidthexport("celestial", 0.01) ) {
               # default
               controls.incAileron(0.05, 1.0)
           }
       }
     </script>
    </binding>
   </key>

   <key n="359">
    <name>Down</name>
    <desc>Decrease elevator or autopilot pitch or move view aft.</desc>
    <repeatable type="bool">true</repeatable>
    <binding>
     <command>nasal</command>
     <script>
       if( !globals.Boeing314.seatsystem.movelengthexport("observer", 0.01) ) {
           if( !globals.Boeing314.seatsystem.movelengthexport("celestial", 0.01) ) {
               if( !globals.Boeing314.autopilotsystem.pitchexport(-5.0) ) {
                   # default
                   controls.incElevator(-0.05, 100);
               }
           }
       }
     </script>
    </binding>
   </key>

   <key n="360">
    <name>PageUp</name>
    <desc>Increase throttle or move view up.</desc>
    <repeatable type="bool">true</repeatable>
    <binding>
     <command>nasal</command>
     <script>
       if( !globals.Boeing314.seatsystem.moveheightexport("observer", 0.01) ) {
           if( !globals.Boeing314.seatsystem.moveheightexport("celestial", 0.01) ) {
               # default
               controls.incThrottle(0.01, 1.0);
           }
       }
     </script>
    </binding>
   </key>

   <key n="361">
    <name>PageDown</name>
    <desc>Decrease throttle or move view down.</desc>
    <repeatable type="bool">true</repeatable>
    <binding>
     <command>nasal</command>
     <script>
       if( !globals.Boeing314.seatsystem.moveheightexport("observer", -0.01) ) {
           if( !globals.Boeing314.seatsystem.moveheightexport("celestial", -0.01) ) {
               # default
               controls.incThrottle(-0.01, -1.0);
           }
       }
     </script>
    </binding>
   </key>

   <key n="362">
    <name>Home</name>
    <desc>Increase elevator trim or autopilot pitch (slow) or move view front (fast)</desc>
    <repeatable type="bool">true</repeatable>
    <binding>
     <command>nasal</command>
     <script>
       if( !globals.Boeing314.seatsystem.movelengthexport("observer", -0.1) ) {
           if( !globals.Boeing314.autopilotsystem.pitchexport(1.0) ) {
               # default
               trim = getprop("/controls/flight/elevator-trim");
               trim = trim + 0.001;
               setprop("/controls/flight/elevator-trim",trim);
           }
       }
     </script>
    </binding>
   </key>

   <key n="363">
    <name>End</name>
    <desc>Decrease elevator trim or autopilot pitch (slow) or move view aft (fast)</desc>
    <repeatable type="bool">true</repeatable>
    <binding>
     <command>nasal</command>
     <script>
       if( !globals.Boeing314.seatsystem.movelengthexport("observer", 0.1) ) {
           if( !globals.Boeing314.autopilotsystem.pitchexport(-1.0) ) {
               # default
               trim = getprop("/controls/flight/elevator-trim");
               trim = trim - 0.001;
               setprop("/controls/flight/elevator-trim",trim);
           }
       }
     </script>
    </binding>
   </key>

</PropertyList>
