    <?xml version="1.0" ?>

    <!--
    ************************************************************************
    * le3dp-rmsjr.xml : version 1.1, January 15th, 2009
    * Modified Bindings for Logitech Extreme Digital 3D Pro joystick.
    *
    * Axis 0           : ailerons
    * Axis 1           : elevator
    * Axis 2 (twist)   : rudder
    * Axis 3 (slider)  : throttle
    * Axis 4 (hat l/r) : rudder trim
    * Axis 5 (hat u/d) : elevator trim
    *
    * Buttons according to the numbers printed on the joystick:
    * Button 1  : push-to-talk for use with FGCOM
    * Button 2  : spoilers, airbrakes, wheelbrakes (automatically applies
    *             differential wheel braking based on rudder position)
    * Button 3  : glance up   (+30deg) while button held
    * Button 4  : glance down (-30deg) while button held, and centers view
    * Button 5  : view -30deg left
    * Button 6  : view +30deg right
    * Button 7  : flaps deploy/down/out/extend
    * Button 8  : flaps stow/up/in/retract
    * Button 9  : gear down/extend          (if airborne)
    *             set parking brake         (if stopped on ground)
    * Button 10 : gear up/retract/in        (if airborne)
    *             release parking brake     (if on ground)
    * Button 11 : arrestor hook down/extend (if airborne)
    *             deploy/open reversers     (if on ground)
    * Button 12 : arrestor hook up/retract, retract reversers
    *
    * Based on original extreme-3d-pro.xml by M. Franz
    * Modified and Extended January 2009 by Rob Shearman, Jr. ("MD-Terp")
    ************************************************************************
    -->

    <PropertyList>

    <name>Logitech Extreme Digital 3D Pro</name>
    <name>Logitech Logitech Extreme 3D Pro</name>
    <name>Logitech Extreme 3D Pro</name>
    <name>Logitech Extreme 3D Pro USB</name>
    <name>Logitech  Extreme  3D  Pro USB</name>

    <axis n="0">
    <desc>Aileron</desc>
    <binding>
    <command>property-scale</command>
    <property>/controls/flight/aileron</property>
    <squared type="bool">true</squared>
    </binding>
    </axis>

    <axis n="1">
    <desc>Elevator</desc>
    <binding>
    <command>property-scale</command>
    <property>/controls/flight/elevator</property>
    <factor type="double">-1.0</factor>
    <squared type="bool">true</squared>
    </binding>
    </axis>

    <axis>
    <desc>Rudder</desc>
    <number>
    <unix>2</unix>
    <windows>3</windows>
    </number>
    <dead-band type="double">0.12</dead-band>
    <binding>
    <command>property-scale</command>
    <property>/controls/flight/rudder</property>
    <factor type="double">1.0</factor>
    </binding>
    </axis>

    <axis>
    <desc>Throttle</desc>
    <number>
    <unix>3</unix>
    <windows>2</windows>
    </number>
    <binding>
    <command>nasal</command>
    <script>controls.throttleAxis()</script>
    </binding>
    </axis>

    <axis>
    <number>
    <unix>4</unix>
    <windows>6</windows>
    </number>
    <desc>Rudder trim</desc>
    <low>
    <repeatable type="bool">true</repeatable>
    <binding>
    <command>nasal</command>
    <script>controls.rudderTrim(-1)</script>
    </binding>
    </low>
    <high>
    <repeatable type="bool">true</repeatable>
    <binding>
    <command>nasal</command>
    <script>controls.rudderTrim(1)</script>
    </binding>
    </high>
    </axis>

    <axis>
    <number>
    <unix>5</unix>
    <windows>7</windows>
    </number>
    <desc>Elevator trim</desc>
    <low>
    <repeatable type="bool">true</repeatable>
    <binding>
    <command>nasal</command>
    <script>controls.elevatorTrim(-1)</script>
    </binding>
    </low>
    <high>
    <repeatable type="bool">true</repeatable>
    <binding>
    <command>nasal</command>
    <script>controls.elevatorTrim(1)</script>
    </binding>
    </high>
    </axis>

    <button n="0">
    <desc>PTT - Push To Talk</desc>
    <binding>
    <command>nasal</command>
    <script>controls.ptt(1)</script>
    </binding>
    <mod-up>
    <binding>
    <command>nasal</command>
    <script>controls.ptt(0)</script>
    </binding>
    </mod-up>
    </button>

    <button n="1">
    <desc>Brakes</desc>
    <repeatable type="bool">true</repeatable>
    <binding>
    <command>nasal</command>
    <script>
    setprop("/controls/flight/spoilers",1);
    setprop("/controls/flight/speedbrake",1);
    var rp = getprop("/controls/flight/rudder");
    if (rp > 0)
      {
        setprop("/controls/gear/brake-left",1-rp);
        setprop("/controls/gear/brake-right",1)
      }
    else
      {
        setprop("/controls/gear/brake-left",1);
        setprop("/controls/gear/brake-right",1+rp)
      }
    </script>
    </binding>
    <mod-up>
    <binding>
    <command>nasal</command>
    <script>
    controls.applyBrakes(0);
    setprop("/controls/flight/spoilers", 0);
    setprop("/controls/flight/speedbrake",0)
    </script>
    </binding>
    </mod-up>
    </button>

    <button n="2">
    <desc>Glance Up</desc>
    <repeatable>false</repeatable>
    <binding>
    <command>nasal</command>
    <script>
    setprop("/sim/current-view/pitch-offset-deg", getprop("/sim/current-view/pitch-offset-deg")+30)
    </script>
    </binding>
    <mod-up>
    <binding>
    <command>nasal</command>
    <script>
    setprop("/sim/current-view/pitch-offset-deg", getprop("/sim/current-view/pitch-offset-deg")-30)
    </script>
    </binding>
    </mod-up>
    </button>

    <button n="3">
    <desc>Glance Down and Center</desc>
    <repeatable>false</repeatable>
    <binding>
    <command>nasal</command>
    <script>
    setprop("/sim/current-view/pitch-offset-deg", getprop("/sim/current-view/pitch-offset-deg")-30);
    setprop("/sim/current-view/heading-offset-deg", 0)
    </script>
    </binding>
    <mod-up>
    <binding>
    <command>nasal</command>
    <script>
    setprop("/sim/current-view/pitch-offset-deg", getprop("/sim/current-view/pitch-offset-deg")+30)
    </script>
    </binding>
    </mod-up>
    </button>

    <button n="4">
    <desc>Look Left</desc>
    <repeatable>false</repeatable>
    <binding>
    <command>nasal</command>
    <script>
    setprop("/sim/current-view/heading-offset-deg", getprop("/sim/current-view/heading-offset-deg")+30)
    </script>
    </binding>
    </button>

    <button n="5">
    <desc>Look Right</desc>
    <repeatable>false</repeatable>
    <binding>
    <command>nasal</command>
    <script>
    setprop("/sim/current-view/heading-offset-deg", getprop("/sim/current-view/heading-offset-deg")-30)
    </script>
    </binding>
    </button>

    <button n="6">
    <desc>Flaps down</desc>
    <binding>
    <command>nasal</command>
    <script>controls.flapsDown(1)</script>
    </binding>
    <mod-up>
    <binding>
    <command>nasal</command>
    <script>controls.flapsDown(0)</script>
    </binding>
    </mod-up>
    </button>

    <button n="7">
    <desc>Flaps up</desc>
    <repeatable>false</repeatable>
    <binding>
    <command>nasal</command>
    <script>controls.flapsDown(-1)</script>
    </binding>
    <mod-up>
    <binding>
    <command>nasal</command>
    <script>controls.flapsDown(0)</script>
    </binding>
    </mod-up>
    </button>

    <button n="8">
    <desc>Gear down or set parking brake</desc>
    <repeatable>false</repeatable>
    <binding>
    <command>nasal</command>
    <script>
    if (getprop("/position/altitude-agl-ft") > 100)
      { controls.gearDown(1) }
    elsif (50 > getprop("/velocities/groundspeed-kt"))
      { setprop("/controls/gear/brake-parking", 1) }
    </script>
    </binding>
    <mod-up>
    <binding>
    <command>nasal</command>
    <script>controls.gearDown(0)</script>
    </binding>
    </mod-up>
    </button>

    <button n="9">
    <desc>Gear up or release parking brake</desc>
    <repeatable>false</repeatable>
    <binding>
    <command>nasal</command>
    <script>
    if (getprop("/position/altitude-agl-ft") > 100)
      { controls.gearDown(-1) }
    else
      { setprop("/controls/gear/brake-parking", 0) }
    </script>
    </binding>
    <mod-up>
    <binding>
    <command>nasal</command>
    <script>controls.gearDown(0)</script>
    </binding>
    </mod-up>
    </button>

    <button n="10">
    <desc>Hook down, or deploy reversers</desc>
    <repeatable>false</repeatable>
    <binding>
    <command>nasal</command>
    <script>
    if (getprop("/position/altitude-agl-ft") > 100)
      {
        setprop("/controls/gear/tailhook",1);
        setprop("/fdm/jsbsim/systems/hook/tailhook-cmd-norm",1)
      }
    else
      {
        setprop("/controls/engines/engine[0]/reverser", 1);
        setprop("/controls/engines/engine[1]/reverser", 1);
        setprop("/controls/engines/engine[2]/reverser", 1);
        setprop("/controls/engines/engine[3]/reverser", 1);
        setprop("/fdm/jsbsim/systems/reverser/command", 1);
      }
    </script>
    </binding>
    </button>

    <button n="11">
    <desc>Hook up, retract reversers</desc>
    <repeatable>false</repeatable>
    <binding>
    <command>nasal</command>
    <script>
    setprop("/controls/gear/tailhook",0);
    setprop("/fdm/jsbsim/systems/hook/tailhook-cmd-norm",0);
    setprop("/controls/engines/engine[0]/reverser", 0);
    setprop("/controls/engines/engine[1]/reverser", 0);
    setprop("/controls/engines/engine[2]/reverser", 0);
    setprop("/controls/engines/engine[3]/reverser", 0);
    setprop("/fdm/jsbsim/systems/reverser/command", 0);
    </script>
    </binding>
    </button>

    </PropertyList>