* keyboard key, a joystick button or axis, or even a panel
* instrument.</p>
*/
-class FGBinding
+class FGBinding : public FGConditional
{
public:
FGBinding ();
- /**
- * Copy constructor.
- */
- FGBinding (const FGBinding &binding);
-
-
/**
* Convenience constructor.
*
};
- typedef vector<FGBinding> binding_list_t;
+ typedef vector<FGBinding *> binding_list_t;
/**
* Settings for a key or button.
: is_repeatable(false),
last_state(-1)
{}
+ virtual ~button () {
+ for (int i = 0; i < FG_MOD_MAX; i++)
+ for (int j = 0; i < bindings[i].size(); j++)
+ delete bindings[i][j];
+ }
bool is_repeatable;
int last_state;
binding_list_t bindings[FG_MOD_MAX];
low_threshold(-0.9),
high_threshold(0.9)
{}
+ virtual ~axis () {
+ for (int i = 0; i < FG_MOD_MAX; i++)
+ for (int j = 0; i < bindings[i].size(); j++)
+ delete bindings[i][j];
+ }
float last_value;
float tolerance;
binding_list_t bindings[FG_MOD_MAX];
/**
* Look up the bindings for a key code.
*/
- const vector<FGBinding> &_find_key_bindings (unsigned int k, int modifiers);
+ const vector<FGBinding *> &_find_key_bindings (unsigned int k,
+ int modifiers);
button _key_bindings[MAX_KEYS];
joystick _joystick_bindings[MAX_JOYSTICKS];