<?xml version="1.0"?>
<!--
************************************************************************
* Bindings for Logitech Extreme Digital 3D Pro joystick.
* polly for GScott Trigger Modifier code orig: A Gilderstan
*
* Rename fgdata/Input/Joysticks/extreme-3d-pro.xml to extreme-3d-pro.xml-bkup
* Rename this file and place in fgdata/Input/Joysticks/extreme-3d-pro.xml
*
* Axis 0: Stick Left/Right Ailerons
* Axis 1: Stick Fwd/Back Elevator
* Axis 2 Sitck Twist Rudder
* Axis 3 Slider Throttle
* Axes 4/5 Hat Elev/Aileron Trim
*
*
* |** LAYOUT TOP VIEW **| |************ ASSIGNMENT ********************|
*
* Btn 1 Modifier for extra button assignments
* (Trigger)
*
* Btn 5 Hat Btn 6 Btn5/6: L/R Brake Hat: Pitch/Roll Trim +Trig:Pan View
*
* Btn 3 Btn 4: Left / Right Rudder trim
*
* Btn 2 Center to Preferred View +Trig:AutoTrim
*
* Btn 7 Btn 8 Btn7: Flaps Up +Trig:Autostart Btn 8: Prop Fine +Trig: Mix Rich
*
* Btn 9 Btn 10 Btn 9: Seat Dn +Trig:Up Btn 10: ~Pkng Bke +Trig: ~Gear
*
* Btn 11 Btn 12 Btn 11: Flaps Dn Btn 12: Prop Coarse +Trig: Mix Lean
*
************************************************************************
$Id$
-->
<PropertyList>
<script/>
<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>
<name>Logitech Extreme 3D</name>
<name>Logitech Logitech Extreme 3D</name>
<!--
data and script block txlates trig button into modifier
-->
<!-- and gets model name for variants -->
<data>
<modeTrig type="bool">false</modeTrig>
</data>
<nasal>
<script>
<![CDATA[
var self = cmdarg().getParent(); var data = self.getNode("data"); var modeTrig = data.getNode("modeTrig"); var model = getprop("/sim/aircraft"); if ( model == "c172p") model = "c172"; if ( model == "c310dpm-3d") model = "c310"; if ( model == "dhc2f") model = "dhc2"; if ( model == "pa24-250") model = "pa24"; if ( model == "pa28-161") model = "pa28"; if ( model == "pa28-wip") model = "pa28"; if ( model == "WarriorII-160") model = "pa28"; if ( model == "WarriorII-180") model = "pa28"; if ( model == "SenecaII") model = "pa34"; var trace = func(str) { # Uncomment the line below to trace button presses. # print("extreme-3dpro.xml : " ~ str); }
]]>
</script>
</nasal>
<!--
For each axis or button the section between binding - /binding tags
-->
<!--
specifies the axis or button's action. There may also be a binding
-->
<!--
for action performed when key is released. Some sections specify
-->
<!--
standard flightgear commands, other actions specify nasal interpreter
-->
<!--
scripts which may need wrapping in CDATA tags to escape special characters
-->
<!--
For tags: button n="x": "x" does not corresond to Makers Labelling
-->
<axis n="0">
<desc>Aileron</desc>
<binding>
<command>property-scale</command>
<property>controls/flight/aileron</property>
<offset type="double">-0.000</offset>
<factor type="double">1</factor>
<power type="int">2</power>
</binding>
<dead-band type="double">0.000001</dead-band>
</axis>
<axis n="1">
<desc>Elevator</desc>
<direction>down/forward</direction>
<binding>
<command>property-scale</command>
<property>controls/flight/elevator</property>
<offset type="double">-0.000</offset>
<factor type="double">-1</factor>
<power type="int">2</power>
</binding>
<dead-band type="double">0.000001</dead-band>
</axis>
<axis>
<number>
<unix>2</unix>
<windows>3</windows>
<mac>2</mac>
</number>
<desc>Rudder</desc>
<binding>
<command>property-scale</command>
<property>controls/flight/rudder</property>
<factor type="double">1</factor>
<power type="int">2</power>
<offset type="double">-0.000</offset>
</binding>
<dead-band type="double">0.000001</dead-band>
</axis>
<axis>
<number>
<unix>3</unix>
<windows>2</windows>
<mac>3</mac>
</number>
<desc>Throttle</desc>
<binding>
<command>nasal</command>
<script>controls.throttleAxis()</script>
</binding>
</axis>
<!-- Trigger Button -->
<button n="0">
<name>Trigger</name>
<desc>Trigger mode '+Trg'; +Shift: trigger</desc>
<binding>
<command>nasal</command>
<script>
trace("Trig Bttn bit 0 press"); modeTrig.setIntValue(1);
</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>
trace("Trig Bttn bit 0 release"); modeTrig.setIntValue(0); controls.trigger(0);
</script>
</binding>
</mod-up>
</button>
<!--
Dflt Brakes replaces with Trigger modifier
<desc>Brakes</desc>
<binding>
<command>nasal</command>
<script>controls.applyBrakes(1)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.applyBrakes(0)</script>
</binding>
</mod-up>
</button>
-->
<!-- Axis 4. Hat left/right -->
<axis>
<desc>Aileron Trim; +Trg: Pan View</desc>
<number>
<unix>4</unix>
<windows>6</windows>
<mac>4</mac>
</number>
<low>
<repeatable type="bool">true</repeatable>
<interval-sec type="double">0.1</interval-sec>
<binding>
<command>nasal</command>
<script>
<![CDATA[
if (! modeTrig.getBoolValue()) { setprop("controls/flight/aileron-trim", (getprop("controls/flight/aileron-trim") -0.001)); } else { setprop("/sim/current-view/heading-offset-deg", (getprop("/sim/current-view/heading-offset-deg") + 4.000)); }
]]>
</script>
</binding>
</low>
<high>
<repeatable type="bool">true</repeatable>
<interval-sec type="double">0.1</interval-sec>
<binding>
<command>nasal</command>
<script>
<![CDATA[
if (! modeTrig.getBoolValue()) { setprop("controls/flight/aileron-trim", (getprop("controls/flight/aileron-trim") +0.001)); } else { setprop("/sim/current-view/heading-offset-deg", (getprop("/sim/current-view/heading-offset-deg") - 4.000)); }
]]>
</script>
</binding>
</high>
</axis>
<!-- Axis 5. Hat Fwd/Back -->
<axis>
<desc>Elevator Trim; +Trg: Tilt view</desc>
<number>
<unix>5</unix>
<windows>7</windows>
<mac>5</mac>
</number>
<low>
<repeatable type="bool">true</repeatable>
<interval-sec type="double">0.1</interval-sec>
<binding>
<command>nasal</command>
<script>
<![CDATA[
if (! modeTrig.getBoolValue()) { setprop("controls/flight/elevator-trim", (getprop("controls/flight/elevator-trim") +0.001)); } else { setprop("/sim/current-view/pitch-offset-deg", (getprop("/sim/current-view/pitch-offset-deg") - 1.500)); }
]]>
</script>
</binding>
</low>
<high>
<repeatable type="bool">true</repeatable>
<interval-sec type="double">0.1</interval-sec>
<binding>
<command>nasal</command>
<script>
<![CDATA[
if (! modeTrig.getBoolValue()) { setprop("controls/flight/elevator-trim", (getprop("controls/flight/elevator-trim") -0.001)); } else { setprop("/sim/current-view/pitch-offset-deg", (getprop("/sim/current-view/pitch-offset-deg") + 1.500)); }
]]>
</script>
</binding>
</high>
</axis>
<button n="1">
<desc>Btn2 Pref View +Trig: Autotrim</desc>
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<!--
Once: Adjust preferred view then copy values from props tree to data below
-->
<script>
<![CDATA[
if (! modeTrig.getBoolValue()) { if ( ( model == "c172") or ( model == "pa28")) { setprop("/sim/current-view/field-of-view", 55.875); setprop("/sim/current-view/heading-offset-deg", 0.000); setprop("/sim/current-view/pitch-offset-deg", -18.970); setprop("/sim/current-view/x-offset-m", -0.300); setprop("/sim/current-view/y-offset-m", 0.350); setprop("/sim/current-view/z-offset-m", 0.425); print("view c172-pa28"); } } else { aircraft.autotrim.start(); }
]]>
</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>
if (modeTrig.getBoolValue()) { aircraft.autotrim.stop(); }
</script>
</binding>
</mod-up>
</button>
<button n="2">
<desc>Btn3 Rddr trim Left </desc>
<repeatable type="bool">true</repeatable>
<binding>
<command>property-adjust</command>
<property>controls/flight/rudder-trim</property>
<step type="double">-0.005</step>
</binding>
</button>
<button n="3">
<desc>Btn4 Rddr trim Right</desc>
<repeatable type="bool">true</repeatable>
<binding>
<command>property-adjust</command>
<property>controls/flight/rudder-trim</property>
<step type="double">+0.005</step>
</binding>
</button>
<button n="4">
<desc>Btn5 Left Brake</desc>
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>
trace("Btn5 press "); if (!modeTrig.getBoolValue()) { controls.applyBrakes(1, -1); } else { }
</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>
if (! modeTrig.getBoolValue()) { controls.applyBrakes(0, -1); } else { }
</script>
</binding>
</mod-up>
</button>
<button n="5">
<desc>Btn6 Right Brake</desc>
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>
trace("Bttn 6 press "); if (!modeTrig.getBoolValue()) { controls.applyBrakes(1, 1); } else { }
</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>
if (! modeTrig.getBoolValue()) { controls.applyBrakes(0, 1); } else { }
</script>
</binding>
</mod-up>
</button>
<button n="6">
<desc>Btn7 Flaps Up</desc>
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>
<![CDATA[
trace("Btn7 press "); if (!modeTrig.getValue()) { controls.flapsDown(-1); } if (modeTrig.getValue()) { if ( model == "c172") { c172p.autostart() } }
]]>
</script>
</binding>
</button>
<button n="7">
<desc>Btn8 PropFine +Trig: Mix Rich </desc>
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>
<![CDATA[
if (! modeTrig.getBoolValue()) { setprop("controls/engine/propeller-pitch", ((getprop("controls/engine/propeller-pitch") or 0) - 0.100)); } else { setprop("controls/engines/current-engine/mixture", ((getprop("controls/engines/current-engine/mixture") or 0) +0.100)); }
]]>
</script>
</binding>
</button>
<button n="8">
<desc>Btn9 Seat Dn +Trig: Seat up </desc>
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>
<![CDATA[
if (! modeTrig.getBoolValue()) { setprop("/sim/current-view/y-offset-m", ((getprop("/sim/current-view/y-offset-m") or 0) - 0.010) ); } else { setprop("/sim/current-view/y-offset-m", ((getprop("/sim/current-view/y-offset-m") or 0) + 0.010) ); }
]]>
</script>
</binding>
</button>
<button n="9">
<desc>Btn10 ~PkngBrake +Trig: ~Gear </desc>
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>
<![CDATA[
if (! modeTrig.getBoolValue()) { controls.parkingBrakeToggle(1); } else { if ( (!getprop("/gear/gear[1]/wow")) and (!getprop("/gear/gear[2]/wow")) and (!getprop("/gear/gear[3]/wow"))) { controls.gearToggle(1); } }
]]>
</script>
</binding>
</button>
<button n="10">
<desc>Btn11 Flaps Down</desc>
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>
<![CDATA[
trace("Btn7 press "); if (!modeTrig.getValue()) { controls.flapsDown( 1); } if (modeTrig.getValue()) { }
]]>
</script>
</binding>
</button>
<button n="11">
<desc>Btn12 Prop Coarse +Trig: Mix Lean</desc>
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>
<![CDATA[
if (! modeTrig.getBoolValue()) { setprop("controls/engine/propeller-pitch", ((getprop("controls/engine/propeller-pitch") or 0) + 0.100)); } else { setprop("controls/engines/current-engine/mixture", ((getprop("controls/engines/current-engine/mixture") or 0) -0.100)); }
]]>
</script>
</binding>
</button>
</PropertyList>
Users browsing this forum: No registered users and 4 guests