#ifndef _FGJOYSTICKINPUT_HXX
#define _FGJOYSTICKINPUT_HXX
-#ifndef __cplusplus
-# error This library requires C++
-#endif
-
#include "FGCommonInput.hxx"
#include "FGButton.hxx"
+
+#include <memory> // for std::auto_ptr
#include <simgear/structure/subsystem_mgr.hxx>
#include <plib/js.h>
virtual void init();
virtual void postinit();
+ virtual void reinit();
virtual void update( double dt );
static const int MAX_JOYSTICKS = 10;
static const int MAX_JOYSTICK_BUTTONS = 32;
private:
+
+
+ void _remove(bool all);
+ SGPropertyNode_ptr status_node;
+
/**
* Settings for a single joystick axis.
*/
float high_threshold;
FGButton low;
FGButton high;
- float interval_sec;
+ float interval_sec, delay_sec, release_delay_sec;
double last_dt;
};
joystick ();
virtual ~joystick ();
int jsnum;
- jsJoystick * js;
+ std::auto_ptr<jsJoystick> plibJS;
int naxes;
int nbuttons;
axis * axes;
FGButton * buttons;
+ bool predefined;
+
+ void clearAxesAndButtons();
};
- joystick bindings[MAX_JOYSTICKS];
-
+
+ joystick joysticks[MAX_JOYSTICKS];
+ void updateJoystick(int index, joystick* joy, double dt);
+
};
#endif