On Saturday 22 September 2007 13:57:05 AJ MacLeod wrote:
snip
> One comment 
> regarding the joystick configuration file; could people please take care to
> use the functions in controls.nas wherever they exist?
>
> For example, instead of hard coding the flaps settings by writing directly
> to the property tree, you should just call controls.flapsDown with the
> relevant argument.  The reason for this is that hard-coded steps are only
> ever going to be right for a few aircraft, while controls.flapsDown should
> always get you realistic behaviour for each aircraft (assuming the author
> has been diligent enough to model the flaps settings correctly).
>
> This goes for every type of control - setting the properties directly is
> discouraged, the functions in controls.nas are the way forwards!  There are
> plenty of examples in existing joystick configuration files to copy.
>
> Cheers,
>
> AJ

Aj,

Thanks for the info about using nasal bindings.  I looked at the docs for 
joystick configuration that were installed on my system as part of installing 
FlightGear and there was no info about using nasal there.  Perhaps the docs 
could be updated.  I found that this works MUCH better. 

Here is an updated version.

<?xml version="1.0" ?>

<PropertyList>

 <name>Saitek Saitek Pro Flight Quadrant</name>

 <axis n="0">
  <desc>Throttle</desc>
  <binding>
   <command>nasal</command>
   <script>controls.throttleAxis()</script>
  </binding>
 </axis>

 
 <axis n="1">
  <desc>Propeller-Pitch</desc>
  <binding>
   <command>nasal</command>
   <script>controls.propellerAxis()</script>
  </binding>
 </axis>

<axis n="2">
  <desc>Mixture</desc>
  <binding>
   <command>nasal</command>
   <script>controls.mixtureAxis()</script>
  </binding>
 </axis>

 <button n="2">
 <desc>Fire Starter on Selected Engine(s)</desc>
  <binding>
   <command>nasal</command>
   <script>controls.startEngine()</script>
  </binding>
  <mod-up>
   <binding>
    <command>nasal</command>
    <script>props.setAll("/controls/engines/engine", "starter", 0)</script>
   </binding>
  </mod-up> 
 </button>

 <button n="0">
  <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="1">
  <desc>Flaps down</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="4">
  <desc>Gear up</desc>
  <repeatable>false</repeatable>
  <binding>
   <command>nasal</command>
   <script>controls.gearDown(-1)</script>
  </binding>
  <mod-up>
   <binding>
    <command>nasal</command>
    <script>controls.gearDown(0)</script>
   </binding>
  </mod-up>
 </button>

 <button n="5">
  <desc>Gear down</desc>
  <repeatable>false</repeatable>
  <binding>
   <command>nasal</command>
   <script>controls.gearDown(1)</script>
  </binding>
  <mod-up>
   <binding>
    <command>nasal</command>
    <script>controls.gearDown(0)</script>
   </binding>
  </mod-up>
 </button>

</PropertyList>

<!-- end of saitekquadrant.xml -->








-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Flightgear-users mailing list
Flightgear-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-users

Reply via email to