<?xml version="1.0"?>

<!--
Bindings for THRUSTMASTER T.Flight Stick X based on presets from the constructor.
by Joffrey Paris
-->

<PropertyList>
 <name type="string">T.Flight Stick X</name>
 <name type="string">Thrustmaster T.Flight Stick X</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>
  <number>
	<windows>2</windows>
  	<unix>3</unix>
  </number>
  <desc>Increase/Reduce Throttle</desc>
  <binding>
   <command>nasal</command>
   <script>controls.throttleAxis()</script>
  </binding>
 </axis>

 <axis>
  <number>
	<windows>3</windows>
  	<unix>2</unix>
  </number>
  <desc>Rudder Left/Right</desc>
  <binding>
   <command>property-scale</command>
   <property>/controls/flight/rudder</property>
   <factor type="double">1.0</factor>
  </binding>
 </axis>

 <axis>
  <number>
	<windows>6</windows>
  	<unix>4</unix>
  </number>
  <desc>View Direction</desc>
  <low>
   <repeatable>true</repeatable>
   <binding>
    <command>property-adjust</command>
    <property>/sim/current-view/goal-heading-offset-deg</property>
    <step type="double">2.0</step>
   </binding>
  </low>
  <high>
   <repeatable>true</repeatable>
   <binding>
    <command>property-adjust</command>
    <property>/sim/current-view/goal-heading-offset-deg</property>
    <step type="double">-2.0</step>
   </binding>
  </high>
 </axis>

 <axis>
  <number>
	<windows>7</windows>
  </number>
  <desc>View Elevation</desc>
  <low>
   <repeatable>true</repeatable>
   <binding>
    <command>property-adjust</command>
    <property>/sim/current-view/goal-pitch-offset-deg</property>
    <step type="double">-2.0</step>
   </binding>
  </low>
  <high>
   <repeatable>true</repeatable>
   <binding>
    <command>property-adjust</command>
    <property>/sim/current-view/goal-pitch-offset-deg</property>
    <step type="double">2.0</step>
   </binding>
  </high>
 </axis>

 <axis>
  <number>
	<unix>5</unix>
  </number>
  <desc>View Elevation</desc>
  <low>
   <repeatable>true</repeatable>
   <binding>
    <command>property-adjust</command>
    <property>/sim/current-view/goal-pitch-offset-deg</property>
    <step type="double">2.0</step>
   </binding>
  </low>
  <high>
   <repeatable>true</repeatable>
   <binding>
    <command>property-adjust</command>
    <property>/sim/current-view/goal-pitch-offset-deg</property>
    <step type="double">-2.0</step>
   </binding>
  </high>
 </axis>

 <button n="0">
  <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>

 <button n="1">
  <desc>Change View</desc>
  <binding>
   <command>nasal</command>
   <script>view.stepView(1)</script>
  </binding>
 </button>

 <button n="2">
  <desc>Trim Nose Up</desc>
  <repeatable type="bool">true</repeatable>
  <binding>
   <command>nasal</command>
   <script>controls.elevatorTrim(1)</script>
  </binding>
 </button>

 <button n="3">
  <desc>Trim Nose Down</desc>
  <repeatable type="bool">true</repeatable>
  <binding>
   <command>nasal</command>
   <script>controls.elevatorTrim(-1)</script>
  </binding>
 </button>

 <button n="4">
  <desc>Extend Flaps Incrementally</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="5">
  <desc>Retract Flaps Incrementally</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="7">
  <desc>Landing gear Up/Down</desc>
  <repeatable>false</repeatable>
  <binding>
   <command>nasal</command>
   <script>controls.gearToggle()</script>
  </binding>
 </button>

</PropertyList>

<!-- end of T.Flight Stick X.xml -->
