From 17166921c0cb91f8cd8df8c1212f20bfc5ef56ea Mon Sep 17 00:00:00 2001 From: mfranz Date: Wed, 22 Jun 2005 13:08:01 +0000 Subject: [PATCH] - 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 --- Input/Joysticks/CH/pro-yoke-usb.xml | 53 ++-- Input/Joysticks/Logitech/extreme-3d-pro.xml | 16 +- Input/Joysticks/Logitech/extreme-3d-win.xml | 16 +- Input/Joysticks/Logitech/freedom2-4.xml | 16 +- .../wingman-extreme-digital-3d-win.xml | 16 +- .../Joysticks/Microsoft/sidewinder-3d-pro.xml | 16 +- .../Microsoft/sidewinder-force-feed-pro.xml | 16 +- .../Microsoft/sidewinder-force-feed.xml | 16 +- .../Microsoft/sidewinder-precision-pro.xml | 16 +- Input/Joysticks/Microsoft/sidewinder.xml | 16 +- .../Saitek/Cyborg-3d-Rumble-Force.xml | 226 +++++++++--------- Input/Joysticks/Saitek/Cyborg-Evo.xml | 40 +++- Input/Joysticks/Saitek/Cyborg-Gold-3d-USB.xml | 84 +++++-- Input/Joysticks/Saitek/X45.xml | 16 +- Input/Joysticks/Saitek/X8-30.xml | 16 +- .../ThrustMaster/Attack-Throttle.xml | 16 +- .../ThrustMaster/Top-Gun-Afterburner.xml | 40 +++- .../ThrustMaster/Top-Gun-Fox2-Pro-USB.xml | 16 +- Nasal/controls.nas | 14 +- keyboard.xml | 34 ++- 20 files changed, 505 insertions(+), 194 deletions(-) diff --git a/Input/Joysticks/CH/pro-yoke-usb.xml b/Input/Joysticks/CH/pro-yoke-usb.xml index 66cf72dcb..2821b1e14 100644 --- a/Input/Joysticks/CH/pro-yoke-usb.xml +++ b/Input/Joysticks/CH/pro-yoke-usb.xml @@ -31,7 +31,8 @@ - + + Mixture 3 @@ -162,54 +163,62 @@ - - - - - --> diff --git a/Input/Joysticks/Saitek/Cyborg-3d-Rumble-Force.xml b/Input/Joysticks/Saitek/Cyborg-3d-Rumble-Force.xml index 9ab24e3a7..8b91fe9de 100644 --- a/Input/Joysticks/Saitek/Cyborg-3d-Rumble-Force.xml +++ b/Input/Joysticks/Saitek/Cyborg-3d-Rumble-Force.xml @@ -34,44 +34,44 @@ $Id$ -Cyborg 3D Rumble Force Joystick + Cyborg 3D Rumble Force Joystick - -Aileron - -property-scale -/controls/flight/aileron -true - - + + Aileron + + property-scale + /controls/flight/aileron + true + + - -Elevator - -property-scale -/controls/flight/elevator --1.0 -true - - + + Elevator + + property-scale + /controls/flight/elevator + -1.0 + true + + - -Throttle - -nasal - - - + + Throttle + + nasal + + + - -Rudder - -property-scale -/controls/flight/rudder -0.0 -1.0 - - + + Rudder + + property-scale + /controls/flight/rudder + 0.0 + 1.0 + + View Direction @@ -139,86 +139,96 @@ $Id$ - + - + + - + - + - + - - - + - diff --git a/Input/Joysticks/Saitek/Cyborg-Evo.xml b/Input/Joysticks/Saitek/Cyborg-Evo.xml index 27f18e9e7..0bcbf5559 100644 --- a/Input/Joysticks/Saitek/Cyborg-Evo.xml +++ b/Input/Joysticks/Saitek/Cyborg-Evo.xml @@ -286,9 +286,9 @@ axis 5: (hat up-down) look u/d Trim Elevator Adj Propeller # + + + nasal + + + @@ -307,7 +324,7 @@ axis 5: (hat up-down) look u/d Trim Elevator Adj Propeller # + + + nasal + + + diff --git a/Input/Joysticks/Saitek/Cyborg-Gold-3d-USB.xml b/Input/Joysticks/Saitek/Cyborg-Gold-3d-USB.xml index 22f0be377..33ec8725a 100644 --- a/Input/Joysticks/Saitek/Cyborg-Gold-3d-USB.xml +++ b/Input/Joysticks/Saitek/Cyborg-Gold-3d-USB.xml @@ -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. -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 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 @@ ________________________________________________________________________________ } + + + nasal + + + diff --git a/Input/Joysticks/Saitek/X8-30.xml b/Input/Joysticks/Saitek/X8-30.xml index afa515bb5..129772fce 100644 --- a/Input/Joysticks/Saitek/X8-30.xml +++ b/Input/Joysticks/Saitek/X8-30.xml @@ -138,16 +138,28 @@ $Id$ Flaps up nasal - + + + + nasal + + + diff --git a/Input/Joysticks/ThrustMaster/Attack-Throttle.xml b/Input/Joysticks/ThrustMaster/Attack-Throttle.xml index a3f2db241..374977ad3 100644 --- a/Input/Joysticks/ThrustMaster/Attack-Throttle.xml +++ b/Input/Joysticks/ThrustMaster/Attack-Throttle.xml @@ -196,8 +196,14 @@ false nasal - + + + + nasal + + + diff --git a/Nasal/controls.nas b/Nasal/controls.nas index f34e763dc..5156d0159 100644 --- a/Nasal/controls.nas +++ b/Nasal/controls.nas @@ -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); } + diff --git a/keyboard.xml b/keyboard.xml index ae5fe3a2b..170fc0d31 100644 --- a/keyboard.xml +++ b/keyboard.xml @@ -531,10 +531,17 @@ calculated by adding 256 to the GLUT key value in glut.h. G Gear down. + false nasal - + + + + nasal + + + @@ -622,8 +629,14 @@ calculated by adding 256 to the GLUT key value in glut.h. Decrease flaps. nasal - + + + + nasal + + + @@ -631,8 +644,14 @@ calculated by adding 256 to the GLUT key value in glut.h. Increase flaps. nasal - + + + + nasal + + + @@ -698,10 +717,17 @@ calculated by adding 256 to the GLUT key value in glut.h. g Gear Up. + false nasal - + + + + nasal + + +