From 217cbcae34fc2d9f52eba326c141e59ebe884c66 Mon Sep 17 00:00:00 2001 From: mfranz Date: Sat, 23 Feb 2008 18:18:55 +0000 Subject: [PATCH] add mod-up action to magneto keys, and ignore that in the controls wrapper; This allows to implement car-like combined magneto/starter switches. --- Nasal/aircraft.nas | 19 +++++++++++-------- Nasal/controls.nas | 6 ++++-- keyboard.xml | 12 ++++++++++++ 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/Nasal/aircraft.nas b/Nasal/aircraft.nas index 05c241c77..5dd13217f 100644 --- a/Nasal/aircraft.nas +++ b/Nasal/aircraft.nas @@ -626,9 +626,11 @@ var livery = { }, }; + + # formation # ============================================================================= -# A modification of the Livery Class. This Class maintains formation +# A modification of the livery class. This class maintains formation # XML files (see Blackburn Buccaneer for an example). Files are regular # PropertyList XML files whose properties are copied to the # main tree (whereby the node types are ignored). @@ -637,21 +639,20 @@ var livery = { # formation.init( [, [, ]]); # # ... directory with livery XML files, relative to $FG_ROOT -# ... property path to the livery name in the livery files -# and the property tree (default: /sim/model/formation/name) -# ... property path to the sort criterion (default: same as -# -- that is: alphabetic sorting) +# ... property path to the livery name in the livery files +# and the property tree (default: /sim/model/formation/name) +# ... property path to the sort criterion (default: same as +# -- that is: alphabetic sorting) # # EXAMPLE: # aircraft.formation.init("Aircraft/Buccaneer/Formations", -# "sim/model/formation/variant", -# "sim/model/formation/index"); # optional +# "sim/model/formation/variant", +# "sim/model/formation/index"); # optional # # aircraft.formation.dialog.toggle(); # aircraft.formation.select("take off"); # aircraft.formation.next(); # - var formation = { init : func(formation_dir, name_path = "sim/model/formation/name", sort_path = nil) { me.dir = formation_dir; @@ -707,6 +708,8 @@ var formation = { }, }; + + # steering # ============================================================================= # Class that implements differential braking depending on rudder position. diff --git a/Nasal/controls.nas b/Nasal/controls.nas index a3107489c..89fb01b98 100644 --- a/Nasal/controls.nas +++ b/Nasal/controls.nas @@ -28,6 +28,8 @@ var selectAllEngines = func { } var stepMagnetos = func(change) { + if (!change) + return; foreach(var e; engines) { if(e.selected.getValue()) { var mag = e.controls.getNode("magnetos", 1); @@ -54,8 +56,8 @@ var throttleMouse = func { } } -# Joystick axis handlers (uses cmdarg). Shouldn't be called from -# other contexts. A non-null argument inverts the direction of the axis. +# Joystick axis handlers (use cmdarg). Shouldn't be called from +# other contexts. A non-null argument reverses the axis direction. var axisHandler = func(pre, post) { func(invert = 0) { var val = cmdarg().getNode("setting").getValue(); diff --git a/keyboard.xml b/keyboard.xml index 6bd3ac5c1..3a06e6659 100644 --- a/keyboard.xml +++ b/keyboard.xml @@ -1044,6 +1044,12 @@ top down before the key bindings are parsed. nasal + + + nasal + + + @@ -1053,6 +1059,12 @@ top down before the key bindings are parsed. nasal + + + nasal + + +