]> git.mxchange.org Git - flightgear.git/blobdiff - src/Input/input.hxx
Patch from Julian Foad:
[flightgear.git] / src / Input / input.hxx
index 6ec7da0f929e66fd0b47e992e51a2170918f9cc2..2ea4217e922a66fc13894244f66b298638120eba 100644 (file)
@@ -123,9 +123,9 @@ public:
 
 
   /**
-   * Fire a binding with x and y positions.
+   * Fire a binding with a scaled movement (rather than absolute position).
    */
-  virtual void fire (int x, int y) const;
+  virtual void fire (double offset, double max) const;
 
 
   /**
@@ -191,7 +191,7 @@ public:
   virtual void init ();
   virtual void bind ();
   virtual void unbind ();
-  virtual void update (int dt);
+  virtual void update (double dt);
 
 
   /**
@@ -246,9 +246,10 @@ private:
     MAX_JOYSTICK_BUTTONS = 32,
 
     MAX_MICE = 1,
-    MAX_MOUSE_BUTTONS
+    MAX_MOUSE_BUTTONS = 8
   };
-
+  struct mouse;
+  friend struct mouse;
 
   typedef vector<FGBinding *> binding_list_t;
 
@@ -295,13 +296,34 @@ private:
   };
 
 
+  /**
+   * Settings for a mouse mode.
+   */
+  struct mouse_mode {
+    mouse_mode ();
+    virtual ~mouse_mode ();
+    int cursor;
+    bool constrained;
+    bool pass_through;
+    button * buttons;
+    binding_list_t x_bindings[FG_MOD_MAX];
+    binding_list_t y_bindings[FG_MOD_MAX];
+  };
+
+
   /**
    * Settings for a mouse.
    */
   struct mouse {
     mouse ();
     virtual ~mouse ();
-    button * buttons;
+    int x;
+    int y;
+    SGPropertyNode * mode_node;
+    SGPropertyNode * mouse_button_nodes[MAX_MOUSE_BUTTONS];
+    int nModes;
+    int current_mode;
+    mouse_mode * modes;
   };
 
 
@@ -373,8 +395,6 @@ private:
   joystick _joystick_bindings[MAX_JOYSTICKS];
   mouse _mouse_bindings[MAX_MICE];
 
-  int _mouse_mode;
-
 };