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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -87,7 +87,8 @@ carbHeatAxis = func {
# Wrapper around stepProps() which emulates the "old" flap behavior for # Wrapper around stepProps() which emulates the "old" flap behavior for
# configurations that aren't using the new mechanism. # configurations that aren't using the new mechanism.
# #
stepFlaps = func { flapsDown = func {
if(arg[0] == 0) { return; }
if(props.globals.getNode("/sim/flaps") != nil) { if(props.globals.getNode("/sim/flaps") != nil) {
stepProps("/controls/flight/flaps", "/sim/flaps", arg[0]); stepProps("/controls/flight/flaps", "/sim/flaps", arg[0]);
return; return;
@ -320,5 +321,12 @@ elevatorTrimAxis = func { elevatorTrim(cmdarg().getNode("value").getValue()); }
aileronTrimAxis = func { aileronTrim(cmdarg().getNode("value").getValue()); } aileronTrimAxis = func { aileronTrim(cmdarg().getNode("value").getValue()); }
rudderTrimAxis = func { rudderTrim(cmdarg().getNode("value").getValue()); } rudderTrimAxis = func { rudderTrim(cmdarg().getNode("value").getValue()); }
gearDown = func { setprop("/controls/gear/gear-down", arg[0]); } gearDown = func {
gearToggle = func { gearDown(!getprop("/controls/gear/gear-down")); } 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"> <key n="71">
<name>G</name> <name>G</name>
<desc>Gear down.</desc> <desc>Gear down.</desc>
<repeatable type="bool">false</repeatable>
<binding> <binding>
<command>nasal</command> <command>nasal</command>
<script>controls.gearDown(1.0)</script> <script>controls.gearDown(1)</script>
</binding> </binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.gearDown(0)</script>
</binding>
</mod-up>
</key> </key>
<key n="72"> <key n="72">
@ -622,8 +629,14 @@ calculated by adding 256 to the GLUT key value in glut.h.
<desc>Decrease flaps.</desc> <desc>Decrease flaps.</desc>
<binding> <binding>
<command>nasal</command> <command>nasal</command>
<script>controls.stepFlaps(-1)</script> <script>controls.flapsDown(-1)</script>
</binding> </binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.flapsDown(0)</script>
</binding>
</mod-up>
</key> </key>
<key n="93"> <key n="93">
@ -631,8 +644,14 @@ calculated by adding 256 to the GLUT key value in glut.h.
<desc>Increase flaps.</desc> <desc>Increase flaps.</desc>
<binding> <binding>
<command>nasal</command> <command>nasal</command>
<script>controls.stepFlaps(1)</script> <script>controls.flapsDown(1)</script>
</binding> </binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.flapsDown(0)</script>
</binding>
</mod-up>
</key> </key>
<key n="97"> <key n="97">
@ -698,10 +717,17 @@ calculated by adding 256 to the GLUT key value in glut.h.
<key n="103"> <key n="103">
<name>g</name> <name>g</name>
<desc>Gear Up.</desc> <desc>Gear Up.</desc>
<repeatable type="bool">false</repeatable>
<binding> <binding>
<command>nasal</command> <command>nasal</command>
<script>controls.gearDown(0.0)</script> <script>controls.gearDown(-1)</script>
</binding> </binding>
<mod-up>
<binding>
<command>nasal</command>
<script>controls.gearDown(0)</script>
</binding>
</mod-up>
</key> </key>
<key n="104"> <key n="104">