-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Attached is an updated version (as a diff against cvs) of the "Saitek X52 Pro
Flight Control System" joystick config I made. I hope this can get into cvs
before release.

Regards,

Arvid Norlander
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)

iD8DBQFHYFW5WmK6ng/aMNkRCj77AKCN0H3n+VMxmieuGEnKWY/BEUINdwCfdyWv
v5Qb6b/0SQJZI9HzD9oCAGI=
=OOKk
-----END PGP SIGNATURE-----
Index: X52-pro.xml
===================================================================
RCS file: /var/cvs/FlightGear-0.9/data/Input/Joysticks/Saitek/X52-pro.xml,v
retrieving revision 1.1
diff -u -p -r1.1 X52-pro.xml
--- X52-pro.xml 4 Dec 2007 12:36:51 -0000       1.1
+++ X52-pro.xml 12 Dec 2007 21:41:45 -0000
@@ -3,7 +3,7 @@
   Based on X52.xml and Aviator.xml
   Modified by Arvid Norlander; 2007-12-03
 
-  This file is released under the GPL license.
+  This file is released under the GPL license version 2 or later.
 -->
 
 <!--
@@ -13,7 +13,8 @@ Common Axis/Buttons
  + Bottom stick hat:            View directions (Increase/Decrease visibility 
& Zoom In/Out when shifted)
  + Throttle foreside hat:       Up/down: View cycles (Shift: flaps up/down). 
Left/right: Rudder trim
  + Throttle slider:             Boost Control (if available)
- + Tirgger:                     Apply all brakes
+ + Trigger:                     Apply all brakes
+ + Trigger (fully pressed):     Fire weapons
  + Fire button:                 Toggle parking brake
  + Stick button "A":            Gear up (Shift: gear down)
  + Stick button "B":            HUD master switch
@@ -22,33 +23,41 @@ Common Axis/Buttons
  + Throttle button "D":         Right brake
  + Throttle button "E":         Left brake
  + Throttle button "i":         PTT (Push to talk, for fgcom)
- + Throttle mouse button:       Start Selected Engine(s)
  + T1/T2:                       Hook up/down (Increase/Decrease spoilers when 
shifted)
  + T3/T4:                       Increase/Decrease slats
  + T5/T6:                       Increase/Decrease Speedbrake 
(Increase/Decrease magneto when shifted)
 
+The modes below has been selected to provide generic functions even if there is
+no specific support for the current aircraft. Mode 3 is likely best if there is
+support for the aircraft in question.
+
 Mode 1: Propeller Aircraft
  + Top rotary dial:             Mixture
  + Bottom rotary dial:          Prop Advance
- + Throttle mouse button:       Start Selected Engine(s)
 
 Mode 2: Jet Aircraft
  + Top rotary dial:             Carb Heat
 
-Mode 3: Not implemented yet
+Mode 3: Aircraft specific.
+ Harrier:
+ + Throttle:
+   * Bottom "rotary dial"       Thrust vector
+ Lightning:
+ + Throttle:
+   * Shifted "D"                Braking chute
 
 Linux Axis Numbers (no idea about window/mac ones, and they are not same as 
plain X52 axis numbers on linux at least):
-  0     Roll (positive == right)
-  1     Pitch (positive == down/back/nose-up)
-  2     Throttle (positive == back/down/idle)
-  3     Bottom "rotary dial" on the throttle (positive == CW)
-  4     Top "rotary dial" on the throttle (positive == CCW)
+  0     Roll ........................................... (positive == right)
+  1     Pitch .......................................... (positive == 
down/back/nose-up)
+  2     Throttle ....................................... (positive == 
back/down/idle)
+  3     Bottom "rotary dial" on the throttle ........... (positive == CW)
+  4     Top "rotary dial" on the throttle .............. (positive == CCW)
   5     Rocker switch ("rudder" control) on the throttle (positive == right)
-  6     Slider on the throttle (positive == forward)
-  7     Lower right hat horizontal axis (positive == right)
-  8     Lower right hat vertical axis (positive == down (Mac positive is UP))
-  9     Mouse Y (positive = up)
-  10    Mouse X (positive = right)
+  6     Slider on the throttle ......................... (positive == forward)
+  7     Lower right hat horizontal axis ................ (positive == right)
+  8     Lower right hat vertical axis .................. (positive == down)
+  9     Mouse Y (positive = up)     (Please don't use this, some of us want to 
map this to mouse in X)
+  10    Mouse X (positive = right)  (Please don't use this, some of us want to 
map this to mouse in X)
 
 Button Numbers (Probably identical b/w Linux/Windows/Mac):
  0  Trigger (half pressed)
@@ -65,7 +74,8 @@ Button Numbers (Probably identical b/w L
 11  T4
 12  T5
 13  T6
-15  Throttle mouse switch
+14  Trigger (fully pressed)
+15  Throttle mouse switch (Please don't use this, some of us want to map this 
to mouse in X)
 16  Throttle forefinger wheel scroll down
 17  Throttle forefinger wheel scroll up
 18  Throttle forefinger wheel click
@@ -89,6 +99,7 @@ Button Numbers (Probably identical b/w L
 36  MFD-select wheel below MFD up
 37  MFD-select wheel below MFD down
 38  MFD-select wheel below MFD click
+
 $Id: X52-pro.xml,v 1.1 2007-12-04 12:36:51 mfranz Exp $
 -->
 <PropertyList>
@@ -109,6 +120,11 @@ $Id: X52-pro.xml,v 1.1 2007-12-04 12:36:
                                var data = self.getNode("data");
                                var modifier  = data.getNode("modifier");
                                var mode      = data.getNode("mode");
+                               # This does not change during a session.
+                               #   Not called plain "aircraft" to prevent
+                               #   overwriting the Nasal/aircraft.nas scope
+                               #   as we need to access that too from here.
+                               var aircraftModel  = getprop("/sim/aircraft");
                        ]]>
                </script>
        </nasal>
@@ -151,7 +167,7 @@ $Id: X52-pro.xml,v 1.1 2007-12-04 12:36:
                                <script>
                                        <![CDATA[
                                                if (modifier.getValue()) {
-                                                       # 
fgcommand("increase-visibility", "/null");
+                                                       
fgcommand("increase-visibility");
                                                } else {
                                                        view.panViewDir(1);
                                                }
@@ -166,7 +182,7 @@ $Id: X52-pro.xml,v 1.1 2007-12-04 12:36:
                                <script>
                                        <![CDATA[
                                                if (modifier.getValue()) {
-                                                       # 
fgcommand("decrease-visibility", "/null");
+                                                       
fgcommand("decrease-visibility");
                                                } else {
                                                        view.panViewDir(-1);
                                                }
@@ -246,6 +262,10 @@ $Id: X52-pro.xml,v 1.1 2007-12-04 12:36:
                                        var val = mode.getValue();
                                        if (val == 1) {
                                                controls.propellerAxis(-1);
+                                       } elsif (val == 3) {
+                                               if (aircraftModel == "harrier") 
{
+                                                       controls.mixtureAxis();
+                                               }
                                        }
                                ]]>
                        </script>
@@ -272,6 +292,8 @@ $Id: X52-pro.xml,v 1.1 2007-12-04 12:36:
                </binding>
        </axis>
 
+       <!-- Buttons -->
+
        <!-- Trigger -->
        <button n="0">
                <desc>Brakes</desc>
@@ -292,7 +314,7 @@ $Id: X52-pro.xml,v 1.1 2007-12-04 12:36:
                        <desc>Toggle parking brake on or off</desc>
                        <binding>
                                <command>nasal</command>
-                               <script>controls.applyParkingBrake(1);</script>
+                               <script>controls.applyParkingBrake(1)</script>
                        </binding>
        </button>
 
@@ -314,17 +336,17 @@ $Id: X52-pro.xml,v 1.1 2007-12-04 12:36:
                <mod-up>
                        <binding>
                                <command>nasal</command>
-                               <script>controls.gearDown(0);</script>
+                               <script>controls.gearDown(0)</script>
                        </binding>
                </mod-up>
        </button>
 
        <!-- Button "B" -->
        <button n="3">
-               <desc>HUD Master Switch</desc>
+               <desc>Cycle HUD colour</desc>
                <binding>
                        <command>nasal</command>
-                       <script>aircraft.HUD.cycle_color();</script>
+                       <script>aircraft.HUD.cycle_color()</script>
                </binding>
        </button>
 
@@ -354,12 +376,12 @@ $Id: X52-pro.xml,v 1.1 2007-12-04 12:36:
                <desc>Shift switch for X52</desc>
                <binding>
                        <command>nasal</command>
-                       <script>modifier.setBoolValue(1);</script>
+                       <script>modifier.setBoolValue(1)</script>
                </binding>
                <mod-up>
                        <binding>
                        <command>nasal</command>
-                       <script>modifier.setBoolValue(0);</script>
+                       <script>modifier.setBoolValue(0)</script>
                        </binding>
                </mod-up>
        </button>
@@ -369,12 +391,25 @@ $Id: X52-pro.xml,v 1.1 2007-12-04 12:36:
                <desc>Right Brake</desc>
                <binding>
                        <command>nasal</command>
-                       <script>controls.applyBrakes(1, 1);</script>
+                       <script>controls.applyBrakes(1, 1)</script>
                </binding>
                <mod-up>
                        <binding>
                                <command>nasal</command>
-                               <script>controls.applyBrakes(0, 1);</script>
+                               <script>
+                                       <![CDATA[
+                                               if (modifier.getValue()) {
+                                                       if (mode.getValue() == 
3) {
+                                                               if 
(aircraftModel == "lightning") {
+                                                                       
setprop("/sim/model/lightning/controls/flight/chute_deployed", 1);
+                                                                       
setprop("/sim/model/lightning/controls/flight/chute_open", 1);
+                                                               }
+                                                       }
+                                               } else {
+                                                       controls.applyBrakes(0, 
1);
+                                               }
+                                       ]]>
+                               </script>
                        </binding>
                </mod-up>
        </button>
@@ -389,7 +424,7 @@ $Id: X52-pro.xml,v 1.1 2007-12-04 12:36:
                <mod-up>
                        <binding>
                                <command>nasal</command>
-                               <script>controls.applyBrakes(0, -1);</script>
+                               <script>controls.applyBrakes(0, -1)</script>
                        </binding>
                </mod-up>
        </button>
@@ -428,12 +463,12 @@ $Id: X52-pro.xml,v 1.1 2007-12-04 12:36:
                </binding>
        </button>
 
-       <!-- Flap control on the T3/T4 -->
+       <!-- Slats control on the T3/T4 -->
        <button n="10">
                <desc>Increase slats</desc>
                <binding>
                        <command>nasal</command>
-                       <script>controls.stepSlats(1);</script>
+                       <script>controls.stepSlats(1)</script>
                </binding>
        </button>
 
@@ -441,11 +476,11 @@ $Id: X52-pro.xml,v 1.1 2007-12-04 12:36:
                <desc>Decrease slats</desc>
                <binding>
                        <command>nasal</command>
-                       <script>controls.stepSlats(-1);</script>
+                       <script>controls.stepSlats(-1)</script>
                </binding>
        </button>
 
-       <!-- per mode functions on the T6/T5 -->
+       <!-- Per mode functions on the T6/T5 -->
        <button n="12">
                <desc>Increase speedbrake; Shift: Increase Magneto</desc>
                <binding>
@@ -479,10 +514,19 @@ $Id: X52-pro.xml,v 1.1 2007-12-04 12:36:
        </button>
 
        <!-- Button "Trigger Maximum pressed" -->
-       <!-- Not implemented yet
        <button n="14">
+               <desc>Fire weapons</desc>
+               <binding>
+                       <command>nasal</command>
+                       <script>controls.trigger(1)</script>
+               </binding>
+               <mod-up>
+                       <binding>
+                               <command>nasal</command>
+                               <script>controls.trigger(0)</script>
+                       </binding>
+               </mod-up>
        </button>
-       -->
 
        <!-- Trim (upper) hat on the stick -->
        <button n="19">
@@ -649,7 +693,7 @@ $Id: X52-pro.xml,v 1.1 2007-12-04 12:36:
                <desc>Mode 1</desc>
                <binding>
                        <command>nasal</command>
-                       <script>mode.setIntValue(1);</script>
+                       <script>mode.setIntValue(1)</script>
                </binding>
        </button>
 
@@ -657,7 +701,7 @@ $Id: X52-pro.xml,v 1.1 2007-12-04 12:36:
                <desc>Mode 2</desc>
                <binding>
                        <command>nasal</command>
-                       <script>mode.setIntValue(2);</script>
+                       <script>mode.setIntValue(2)</script>
                </binding>
        </button>
 
@@ -665,7 +709,7 @@ $Id: X52-pro.xml,v 1.1 2007-12-04 12:36:
                <desc>Mode 3</desc>
                <binding>
                        <command>nasal</command>
-                       <script>mode.setIntValue(3);</script>
+                       <script>mode.setIntValue(3)</script>
                </binding>
        </button>
 
@@ -674,27 +718,12 @@ $Id: X52-pro.xml,v 1.1 2007-12-04 12:36:
                <desc>PTT (for fgcom)</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>
-
-       <!-- mouse button on the throttle -->
-       <button n="15">
-               <desc>Fire Starter on Selected Engine(s)</desc>
-               <binding>
-                               <command>nasal</command>
-                               <script>controls.startEngine();</script>
+                       <script>controls.ptt(1)</script>
                </binding>
                <mod-up>
                        <binding>
                                <command>nasal</command>
-                               
<script>props.setAll("/controls/engines/engine", "starter", 0);</script>
+                               <script>controls.ptt(0)</script>
                        </binding>
                </mod-up>
        </button>
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to