]> git.mxchange.org Git - flightgear.git/blobdiff - src/Input/input.hxx
- adjusted for no-value constructor for FGPanel
[flightgear.git] / src / Input / input.hxx
index b63dac855a434c975a5c133026203a9824b8ca7f..bc7bb55c42bea973096520101eae86a7f6cc47ae 100644 (file)
@@ -184,19 +184,23 @@ public:
 
 private:
 
-  typedef vector<FGBinding> binding_list_t;
-
                                // Constants
-  static const int MAX_KEYS = 1024;
+  enum 
+  {
+    MAX_KEYS = 1024,
+
   #ifdef WIN32
-  static const int MAX_JOYSTICKS = 2;
+    MAX_JOYSTICKS = 2,
   #else
-  static const int MAX_JOYSTICKS = 10;
+    MAX_JOYSTICKS = 10,
   #endif
-  static const int MAX_AXES = _JS_MAX_AXES;
-  static const int MAX_BUTTONS = 32;
+    MAX_AXES = _JS_MAX_AXES,
+    MAX_BUTTONS = 32
+  };
 
 
+  typedef vector<FGBinding> binding_list_t;
+
   /**
    * Settings for a key or button.
    */
@@ -217,11 +221,17 @@ private:
   struct axis {
     axis ()
       : last_value(9999999),
-       tolerance(0.002)
+       tolerance(0.002),
+       low_threshold(-0.9),
+       high_threshold(0.9)
     {}
     float last_value;
     float tolerance;
     binding_list_t bindings[FG_MOD_MAX];
+    float low_threshold;
+    float high_threshold;
+    struct button low;
+    struct button high;
   };
 
 
@@ -254,6 +264,14 @@ private:
   void _init_joystick ();
 
 
+  /**
+   * Initialize a single button.
+   */
+  inline void _init_button (const SGPropertyNode * node,
+                           button &b,
+                           const string name);
+
+
   /**
    * Update the keyboard.
    */
@@ -266,6 +284,12 @@ private:
   void _update_joystick ();
 
 
+  /**
+   * Update a single button.
+   */
+  inline void _update_button (button &b, int modifiers, bool pressed);
+
+
   /**
    * Read bindings and modifiers.
    */