/**
- * 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;
/**
virtual void init ();
virtual void bind ();
virtual void unbind ();
- virtual void update (int dt);
+ virtual void update (double dt);
/**
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;
};
+ /**
+ * 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;
};
joystick _joystick_bindings[MAX_JOYSTICKS];
mouse _mouse_bindings[MAX_MICE];
- int _mouse_mode;
-
};