1
0
Fork 0

- rename controls.stepFlaps() to controls.flapsDown(), because:

- to support "old-style" gear/flap control (operation as long as button
  pressed/lever pushed -> b29/hurricane), let bindings not only report
  up/down, but up (-1), stop (0), down (1).
- let controls.flapsDown() ignore "stop" so as to remain compatible with
  prior behavior
- adapt all joysticks/aircraft (sigh)
- some minor cosmetics in joystick configs, such as indentation fixes
This commit is contained in:
mfranz 2005-06-22 13:08:01 +00:00
parent a96b1d75cd
commit 17166921c0
20 changed files with 505 additions and 194 deletions

View file

@ -31,7 +31,8 @@
<script>controls.throttleAxis()</script>
</binding>
</axis>
<axis>
<axis>
<desc>Mixture</desc>
<number>
<unix>3</unix>
@ -162,54 +163,62 @@
</button>
<button n="4">
<desc>Gear up</desc>
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>controls.gearDown(0)</script>
<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>
<button n="6">
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>controls.stepFlaps(-1)</script>
</binding>
</button>
<button n="7">
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>controls.stepFlaps(1)</script>
</binding>
</button>
<!--
<button n="6">
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>controls.stepFlaps(-1)</script>
<script>controls.flapsDown(-1)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.flapsDown(0)</script>
</binding>
</mod-up>
</button>
<button n="7">
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>controls.stepFlaps(1)</script>
<script>controls.flapsDown(1)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.flapsDown(0)</script>
</binding>
</mod-up>
</button>
-->
<button n="8">
<repeatable>true</repeatable>

View file

@ -154,8 +154,14 @@ $Id$
<desc>Flaps down</desc>
<binding>
<command>nasal</command>
<script>controls.stepFlaps(1)</script>
<script>controls.flapsDown(1)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.flapsDown(0)</script>
</binding>
</mod-up>
</button>
<button n="5">
@ -163,8 +169,14 @@ $Id$
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>controls.stepFlaps(-1)</script>
<script>controls.flapsDown(-1)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.flapsDown(0)</script>
</binding>
</mod-up>
</button>
<button n="11">

View file

@ -146,16 +146,28 @@ $Id$
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>controls.stepFlaps(1)</script>
<script>controls.flapsDown(1)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.flapsDown(0)</script>
</binding>
</mod-up>
</button>
<button n="3">
<desc>Flaps up</desc>
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>controls.stepFlaps(-1)</script>
<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>Right brake</desc>

View file

@ -213,8 +213,14 @@
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>controls.stepFlaps(-1)</script>
<script>controls.flapsDown(-1)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.flapsDown(0)</script>
</binding>
</mod-up>
</button>
<button>
@ -226,8 +232,14 @@
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>controls.stepFlaps(1)</script>
<script>controls.flapsDown(1)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.flapsDown(0)</script>
</binding>
</mod-up>
</button>
<button>

View file

@ -203,8 +203,14 @@ $Id$
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>controls.stepFlaps(-1)</script>
<script>controls.flapsDown(-1)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.flapsDown(0)</script>
</binding>
</mod-up>
</button>
<button>
@ -217,8 +223,14 @@ $Id$
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>controls.stepFlaps(1)</script>
<script>controls.flapsDown(1)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.flapsDown(0)</script>
</binding>
</mod-up>
</button>
<button>

View file

@ -168,8 +168,14 @@
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>controls.stepFlaps(1)</script>
<script>controls.flapsDown(1)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.flapsDown(0)</script>
</binding>
</mod-up>
</button>
<button n="5">
@ -177,8 +183,14 @@
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>controls.stepFlaps(-1)</script>
<script>controls.flapsDown(-1)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.flapsDown(0)</script>
</binding>
</mod-up>
</button>
<button n="6">

View file

@ -174,8 +174,14 @@ $Id:
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>controls.stepFlaps(1)</script>
<script>controls.flapsDown(1)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.flapsDown(0)</script>
</binding>
</mod-up>
</button>
<button n="7">
@ -183,8 +189,14 @@ $Id:
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>controls.stepFlaps(-1)</script>
<script>controls.flapsDown(-1)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.flapsDown(0)</script>
</binding>
</mod-up>
</button>
<button n="4">

View file

@ -153,8 +153,14 @@ $Id$
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>controls.stepFlaps(1)</script>
<script>controls.flapsDown(1)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.flapsDown(0)</script>
</binding>
</mod-up>
</button>
<button n="7">
@ -162,8 +168,14 @@ $Id$
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>controls.stepFlaps(-1)</script>
<script>controls.flapsDown(-1)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.flapsDown(0)</script>
</binding>
</mod-up>
</button>
<button n="4">

View file

@ -209,8 +209,14 @@ $Id$
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>controls.stepFlaps(-1)</script>
<script>controls.flapsDown(-1)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.flapsDown(0)</script>
</binding>
</mod-up>
</button>
<button n="5">
@ -218,8 +224,14 @@ $Id$
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>controls.stepFlaps(1)</script>
<script>controls.flapsDown(1)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.flapsDown(0)</script>
</binding>
</mod-up>
</button>
<button n="6">

View file

@ -140,8 +140,14 @@ $Id$
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>controls.stepFlaps(-1)</script>
<script>controls.flapsDown(-1)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.flapsDown(0)</script>
</binding>
</mod-up>
</button>
<button n="7">
@ -149,8 +155,14 @@ $Id$
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>controls.stepFlaps(1)</script>
<script>controls.flapsDown(1)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.flapsDown(0)</script>
</binding>
</mod-up>
</button>
-->

View file

@ -34,44 +34,44 @@ $Id$
<PropertyList>
<name>Cyborg 3D Rumble Force Joystick</name>
<name>Cyborg 3D Rumble Force Joystick</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="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 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 n="2">
<desc>Throttle</desc>
<binding>
<command>nasal</command>
<script>controls.throttleAxis()</script>
</binding>
</axis>
<axis n="2">
<desc>Throttle</desc>
<binding>
<command>nasal</command>
<script>controls.throttleAxis()</script>
</binding>
</axis>
<axis n="3">
<desc>Rudder</desc>
<binding>
<command>property-scale</command>
<property>/controls/flight/rudder</property>
<offset type="double">0.0</offset>
<factor type="double">1.0</factor>
</binding>
</axis>
<axis n="3">
<desc>Rudder</desc>
<binding>
<command>property-scale</command>
<property>/controls/flight/rudder</property>
<offset type="double">0.0</offset>
<factor type="double">1.0</factor>
</binding>
</axis>
<axis n="6">
<desc>View Direction</desc>
@ -139,86 +139,96 @@ $Id$
</mod-up>
</button>
<button n="1">
<desc>External Views</desc>
<repeatable type="bool">false</repeatable>
<binding>
<command>view-cycle</command>
<step type="double">1</step>
</binding>
</button>
<button n="1">
<desc>External Views</desc>
<repeatable type="bool">false</repeatable>
<binding>
<command>view-cycle</command>
<step type="double">1</step>
</binding>
</button>
<button n="2">
<desc>Left Brake</desc>
<binding>
<command>property-assign</command>
<property>/controls/gear/brake-left</property>
<value type="double">1.0</value>
</binding>
<mod-up>
<binding>
<command>property-assign</command>
<property>/controls/gear/brake-left</property>
<value type="double">0.0</value>
</binding>
</mod-up>
</button>
<button n="2">
<desc>Left Brake</desc>
<binding>
<command>property-assign</command>
<property>/controls/gear/brake-left</property>
<value type="double">1.0</value>
</binding>
<mod-up>
<binding>
<command>property-assign</command>
<property>/controls/gear/brake-left</property>
<value type="double">0.0</value>
</binding>
</mod-up>
</button>
<button n="3">
<desc>Right Brake</desc>
<binding>
<command>property-assign</command>
<property>/controls/gear/brake-right</property>
<value type="double">1.0</value>
</binding>
<mod-up>
<binding>
<command>property-assign</command>
<property>/controls/gear/brake-right</property>
<value type="double">0.0</value>
</binding>
</mod-up>
</button>
<button n="3">
<desc>Right Brake</desc>
<binding>
<command>property-assign</command>
<property>/controls/gear/brake-right</property>
<value type="double">1.0</value>
</binding>
<mod-up>
<binding>
<command>property-assign</command>
<property>/controls/gear/brake-right</property>
<value type="double">0.0</value>
</binding>
</mod-up>
</button>
<button n="5">
<desc>Elevator trim down</desc>
<repeatable type="bool">true</repeatable>
<binding>
<command>property-adjust</command>
<property>/controls/flight/elevator-trim</property>
<step type="double">0.001</step>
</binding>
</button>
<button n="5">
<desc>Elevator trim down</desc>
<repeatable type="bool">true</repeatable>
<binding>
<command>property-adjust</command>
<property>/controls/flight/elevator-trim</property>
<step type="double">0.001</step>
</binding>
</button>
<button n="6">
<desc>Elevator trim up</desc>
<repeatable type="bool">true</repeatable>
<binding>
<command>property-adjust</command>
<property>/controls/flight/elevator-trim</property>
<step type="double">-0.001</step>
</binding>
</button>
<button n="6">
<desc>Elevator trim up</desc>
<repeatable type="bool">true</repeatable>
<binding>
<command>property-adjust</command>
<property>/controls/flight/elevator-trim</property>
<step type="double">-0.001</step>
</binding>
</button>
<button n="7">
<desc>Step Flaps Down</desc>
<repeatable type="bool">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>Step Flaps Down</desc>
<repeatable type="bool">false</repeatable>
<binding>
<command>nasal</command>
<script>controls.stepFlaps(1)</script>
</binding>
</button>
<button n="8">
<desc>Step Flaps Up</desc>
<repeatable type="bool">false</repeatable>
<binding>
<command>nasal</command>
<script>controls.stepFlaps(-1)</script>
</binding>
</button>
<button n="8">
<desc>Step Flaps Up</desc>
<repeatable type="bool">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>
</PropertyList>

View file

@ -286,9 +286,9 @@ axis 5: (hat up-down) look u/d Trim Elevator Adj Propeller #
<script>
mod = getprop("/input/joysticks/js[0]/saitek-cyborg-evo-modifier");
if (mod == nil or mod == 0) {
controls.stepFlaps(-1);
controls.flapsDown(-1);
} elsif (mod == 1) {
controls.gearDown(0);
controls.gearDown(-1);
} elsif (mod == 2) {
view.increase();
} elsif (mod == 3) {
@ -296,6 +296,23 @@ axis 5: (hat up-down) look u/d Trim Elevator Adj Propeller #
}
</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>
mod = getprop("/input/joysticks/js[0]/saitek-cyborg-evo-modifier");
if (mod == nil or mod == 0) {
controls.flapsDown(0);
} elsif (mod == 1) {
controls.gearDown(0);
} elsif (mod == 2) {
#
} elsif (mod == 3) {
#
}
</script>
</binding>
</mod-up>
</button>
<!-- Right Button below Hat-switch, labeled "4" -->
@ -307,7 +324,7 @@ axis 5: (hat up-down) look u/d Trim Elevator Adj Propeller #
<script>
mod = getprop("/input/joysticks/js[0]/saitek-cyborg-evo-modifier");
if (mod == nil or mod == 0) {
controls.stepFlaps(1);
controls.flapsDown(1);
} elsif (mod == 1) {
controls.gearDown(1);
} elsif (mod == 2) {
@ -317,6 +334,23 @@ axis 5: (hat up-down) look u/d Trim Elevator Adj Propeller #
}
</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>
mod = getprop("/input/joysticks/js[0]/saitek-cyborg-evo-modifier");
if (mod == nil or mod == 0) {
controls.flapsDown(0);
} elsif (mod == 1) {
controls.gearDown(0);
} elsif (mod == 2) {
#
} elsif (mod == 3) {
#
}
</script>
</binding>
</mod-up>
</button>
<!-- Button left of Hat switch, Labeled '5' -->

View file

@ -6,28 +6,28 @@ $Id$
_______________________________________ Layout _______________________________________
axis 0: aileron
axis 1: elevator
axis 2: rudder
axis 3: throttle
axis 0: aileron
axis 1: elevator
axis 2: rudder
axis 3: throttle
no modifier F3 F4 F3+F4
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
button 0 (trigger): brakes parking brake speed brake thrust revers.
button 1 (left): flaps up gear up previous view *
button 2 (middle): reset view dir tail wheel lock cockpit view reset all trim
button 3 (right): flaps down gear down next view *
button 4 (F1): brakes left * zoom out *
button 5 (F2): brakes right * zoom in *
button 6 (F3): //////////////////////// modifier 0 /////////////////////////
button 7 (F4): //////////////////////// modifier 1 /////////////////////////
button 8 (>>): * * * *
button 9 (<<): * * * *
hat left: look left leaner mixture aileron trim rudder trim
hat right: look right richer mixture aileron trim rudder trim
hat back: look down dec prop pitch elevator trim *
hat forward: look up inc prop pitch elevator trim *
no modifier F3 F4 F3+F4
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
button 0 (trigger): brakes parking brake speed brake thrust revers.
button 1 (left): flaps up gear up previous view *
button 2 (middle): reset view dir tail wheel lock cockpit view reset all trim
button 3 (right): flaps down gear down next view *
button 4 (F1): brakes left * zoom out *
button 5 (F2): brakes right * zoom in *
button 6 (F3): //////////////////////// modifier 0 /////////////////////////
button 7 (F4): //////////////////////// modifier 1 /////////////////////////
button 8 (>>): * * * *
button 9 (<<): * * * *
hat left: look left leaner mixture aileron trim rudder trim
hat right: look right richer mixture aileron trim rudder trim
hat back: look down dec prop pitch elevator trim *
hat forward: look up inc prop pitch elevator trim *
F3 and F4 are used like "Shift", "Control", or "Alternate" on computer keyboards.
@ -59,10 +59,10 @@ e.g. ~~config=$HOME/.fgfs/preferences.xml.
</PropertyList>
The property "/input/joysticks/js[0]/data/modifier" indicates
the "shift" level. F3 sets bit 0, F4 sets bit 1. The property is 'nil' or
zero if none of the shift buttons is pressed, 1 if F3 is pressed, 2 if F4
is pressed, and 3 if both F3 and F4 are pressed.
The property "/input/joysticks/js[0]/data/modifier" indicates the "shift" level.
F3 sets bit 0, F4 sets bit 1. The property is zero if none of the shift buttons
is pressed, 1 if F3 is pressed, 2 if F4 is pressed, and 3 if both F3 and F4 are
pressed.
Note that you have to enclose nasal scripts in <script><![CDATA[...]]></script>
if they contain characters that interfere with the xml markup. This is the case
@ -222,7 +222,7 @@ ________________________________________________________________________________
if (m == 0) {
controls.stepFlaps(-1);
} elsif (m == 1) {
controls.gearDown(0);
controls.gearDown(-1);
} elsif (m == 2) {
view.stepView(-1);
} elsif (m == 3) {
@ -230,6 +230,23 @@ ________________________________________________________________________________
}
</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>
m = get_mode();
if (m == 0) {
controls.stepFlaps(0);
} elsif (m == 1) {
controls.gearDown(0);
} elsif (m == 2) {
#
} elsif (m == 3) {
#
}
</script>
</binding>
</mod-up>
</button>
<button n="2"><!-- middle -->
@ -275,6 +292,23 @@ ________________________________________________________________________________
}
</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>
m = get_mode();
if (m == 0) {
controls.stepFlaps(0);
} elsif (m == 1) {
controls.gearDown(0);
} elsif (m == 2) {
#
} elsif (m == 3) {
#
}
</script>
</binding>
</mod-up>
</button>
<button n="4"><!-- F1 -->

View file

@ -299,16 +299,28 @@ $Id$
<desc>Decrease flaps</desc>
<binding>
<command>nasal</command>
<script>controls.stepFlaps(-1)</script>
<script>controls.flapsDown(-1)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.flapsDown(0)</script>
</binding>
</mod-up>
</button>
<button n="20">
<desc>Increase flaps</desc>
<binding>
<command>nasal</command>
<script>controls.stepFlaps(1)</script>
<script>controls.flapsDown(1)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.flapsDown(0)</script>
</binding>
</mod-up>
</button>
<!-- Rudder trim on the flap hat -->

View file

@ -138,16 +138,28 @@ $Id$
<desc>Flaps up</desc>
<binding>
<command>nasal</command>
<script>controls.stepFlaps(-1)</script>
<script>controls.flapsDown(-1)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.flapsDown(0)</script>
</binding>
</mod-up>
</button>
<button n="3">
<desc>Flaps down</desc>
<binding>
<command>nasal</command>
<script>controls.stepFlaps(1)</script>
<script>controls.flapsDown(1)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.flapsDown(0)</script>
</binding>
</mod-up>
</button>
</PropertyList>

View file

@ -196,8 +196,14 @@
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>controls.stepFlaps(1)</script>
<script>controls.flapsDown(1)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.flapsDown(0)</script>
</binding>
</mod-up>
</button>
<button n="7">
@ -205,8 +211,14 @@
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>controls.stepFlaps(-1)</script>
<script>controls.flapsDown(-1)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.flapsDown(0)</script>
</binding>
</mod-up>
</button>
<button n="4">

View file

@ -269,9 +269,9 @@ ________________________________________________________________________________
<script>
mod = getprop("/input/joysticks/js[0]/thrustmaster-top-gun-afterburner-modifier");
if (mod == nil or mod == 0) {
controls.stepFlaps(-1);
controls.flapsDown(-1);
} elsif (mod == 1) {
controls.gearDown(0);
controls.gearDown(-1);
} elsif (mod == 2) {
view.stepView(-1);
} elsif (mod == 3) {
@ -279,6 +279,23 @@ ________________________________________________________________________________
}
</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>
mod = getprop("/input/joysticks/js[0]/thrustmaster-top-gun-afterburner-modifier");
if (mod == nil or mod == 0) {
controls.flapsDown(0);
} elsif (mod == 1) {
controls.gearDown(0);
} elsif (mod == 2) {
#
} elsif (mod == 3) {
#
}
</script>
</binding>
</mod-up>
</button>
<button n="2"><!-- front right -->
@ -318,7 +335,7 @@ ________________________________________________________________________________
<script>
mod = getprop("/input/joysticks/js[0]/thrustmaster-top-gun-afterburner-modifier");
if (mod == nil or mod == 0) {
controls.stepFlaps(1);
controls.flapsDown(1);
} elsif (mod == 1) {
controls.gearDown(1);
} elsif (mod == 2) {
@ -328,6 +345,23 @@ ________________________________________________________________________________
}
</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>
mod = getprop("/input/joysticks/js[0]/thrustmaster-top-gun-afterburner-modifier");
if (mod == nil or mod == 0) {
controls.flapsDown(0);
} elsif (mod == 1) {
controls.gearDown(0);
} elsif (mod == 2) {
#
} elsif (mod == 3) {
#
}
</script>
</binding>
</mod-up>
</button>
<button n="4"><!-- throttle down/back -->

View file

@ -147,8 +147,14 @@
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>controls.stepFlaps(-1)</script>
<script>controls.flapsDown(-1)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.flapsDown(0)</script>
</binding>
</mod-up>
</button>
<button n="5">
@ -166,8 +172,14 @@
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>controls.stepFlaps(1)</script>
<script>controls.flapsDown(1)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.flapsDown(0)</script>
</binding>
</mod-up>
</button>
</PropertyList>

View file

@ -87,7 +87,8 @@ carbHeatAxis = func {
# Wrapper around stepProps() which emulates the "old" flap behavior for
# configurations that aren't using the new mechanism.
#
stepFlaps = func {
flapsDown = func {
if(arg[0] == 0) { return; }
if(props.globals.getNode("/sim/flaps") != nil) {
stepProps("/controls/flight/flaps", "/sim/flaps", arg[0]);
return;
@ -320,5 +321,12 @@ elevatorTrimAxis = func { elevatorTrim(cmdarg().getNode("value").getValue()); }
aileronTrimAxis = func { aileronTrim(cmdarg().getNode("value").getValue()); }
rudderTrimAxis = func { rudderTrim(cmdarg().getNode("value").getValue()); }
gearDown = func { setprop("/controls/gear/gear-down", arg[0]); }
gearToggle = func { gearDown(!getprop("/controls/gear/gear-down")); }
gearDown = func {
if (arg[0] < 0) {
setprop("/controls/gear/gear-down", 0);
} elsif (arg[0] > 0) {
setprop("/controls/gear/gear-down", 1);
}
}
gearToggle = func { gearDown(getprop("/controls/gear/gear-down") > 0 ? 0 : 1); }

View file

@ -531,10 +531,17 @@ calculated by adding 256 to the GLUT key value in glut.h.
<key n="71">
<name>G</name>
<desc>Gear down.</desc>
<repeatable type="bool">false</repeatable>
<binding>
<command>nasal</command>
<script>controls.gearDown(1.0)</script>
<script>controls.gearDown(1)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.gearDown(0)</script>
</binding>
</mod-up>
</key>
<key n="72">
@ -622,8 +629,14 @@ calculated by adding 256 to the GLUT key value in glut.h.
<desc>Decrease flaps.</desc>
<binding>
<command>nasal</command>
<script>controls.stepFlaps(-1)</script>
<script>controls.flapsDown(-1)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.flapsDown(0)</script>
</binding>
</mod-up>
</key>
<key n="93">
@ -631,8 +644,14 @@ calculated by adding 256 to the GLUT key value in glut.h.
<desc>Increase flaps.</desc>
<binding>
<command>nasal</command>
<script>controls.stepFlaps(1)</script>
<script>controls.flapsDown(1)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.flapsDown(0)</script>
</binding>
</mod-up>
</key>
<key n="97">
@ -698,10 +717,17 @@ calculated by adding 256 to the GLUT key value in glut.h.
<key n="103">
<name>g</name>
<desc>Gear Up.</desc>
<repeatable type="bool">false</repeatable>
<binding>
<command>nasal</command>
<script>controls.gearDown(0.0)</script>
<script>controls.gearDown(-1)</script>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.gearDown(0)</script>
</binding>
</mod-up>
</key>
<key n="104">