FGBinding ();
+ /**
+ * Copy constructor.
+ */
+ FGBinding (const FGBinding &binding);
+
+
/**
* Convenience constructor.
*
private:
- void _fire (const SGPropertyNode *arg) const;
string _command_name;
SGCommandMgr::command_t _command;
- const SGPropertyNode * _arg;
+ mutable SGPropertyNode * _arg;
+ mutable SGPropertyNode * _setting;
+ mutable SGCommandState * _command_state;
};
private:
- typedef vector<FGBinding> binding_list_t;
-
// Constants
enum
{
};
+ typedef vector<FGBinding> binding_list_t;
+
/**
* Settings for a key or button.
*/
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;
};
void _init_joystick ();
+ /**
+ * Initialize a single button.
+ */
+ inline void _init_button (const SGPropertyNode * node,
+ button &b,
+ const string name);
+
+
/**
* Update the keyboard.
*/
void _update_joystick ();
+ /**
+ * Update a single button.
+ */
+ inline void _update_button (button &b, int modifiers, bool pressed);
+
+
/**
* Read bindings and modifiers.
*/