]> git.mxchange.org Git - flightgear.git/commitdiff
Add the axis buttons to the list of items to check only once every 50 ms.
authorehofman <ehofman>
Wed, 4 Jun 2003 13:35:23 +0000 (13:35 +0000)
committerehofman <ehofman>
Wed, 4 Jun 2003 13:35:23 +0000 (13:35 +0000)
src/Input/input.cxx

index 18fd7cdb17c0c7a4f38b8335f1d060c804ead34a..14e1dd4f5cbe37054aeda1d62ac0b06a1c383c79 100644 (file)
@@ -727,17 +727,19 @@ FGInput::_update_joystick (double dt)
       }
      
                                 // do we have to emulate axis buttons?
-      if (a.low.bindings[modifiers].size())
-        _update_button(_joystick_bindings[i].axes[j].low,
-                       modifiers,
-                       axis_values[j] < a.low_threshold,
-                       -1, -1);
-      
-      if (a.high.bindings[modifiers].size())
-        _update_button(_joystick_bindings[i].axes[j].high,
-                       modifiers,
-                       axis_values[j] > a.high_threshold,
-                       -1, -1);
+      if (_last_dt > 0.05) {
+        if (a.low.bindings[modifiers].size())
+          _update_button(_joystick_bindings[i].axes[j].low,
+                         modifiers,
+                         axis_values[j] < a.low_threshold,
+                         -1, -1);
+
+        if (a.high.bindings[modifiers].size())
+          _update_button(_joystick_bindings[i].axes[j].high,
+                         modifiers,
+                         axis_values[j] > a.high_threshold,
+                         -1, -1);
+      }
     }
 
                                 // Fire bindings for the buttons.