*/
class FGInputDevice : public SGReferenced {
public:
- FGInputDevice() : debugEvents(false) {}
+ FGInputDevice() : debugEvents(false), grab(false) {}
FGInputDevice( string aName ) : name(aName) {}
virtual ~FGInputDevice();
handledEvents[handledEvent->GetName()] = handledEvent;
}
+ virtual void Configure( SGPropertyNode_ptr deviceNode );
+
virtual void update( double dt );
bool GetDebugEvents () const { return debugEvents; }
- void SetDebugEvents( bool value ) { debugEvents = value; }
+
+ bool GetGrab() const { return grab; }
+
+ const string & GetNasalModule() const { return nasalModule; }
private:
// A map of events, this device handles
// print out events comming in from the device
// if true
bool debugEvents;
+
+ // grab the device exclusively, if O/S supports this
+ // so events are not sent to other applications
+ bool grab;
+
+ SGPropertyNode_ptr deviceNode;
+ string nasalModule;
};
typedef SGSharedPtr<FGInputDevice> FGInputDevice_ptr;
virtual void postinit();
virtual void update( double dt );
+ const static unsigned MAX_DEVICES = 1000;
+ const static unsigned INVALID_DEVICE_INDEX = MAX_DEVICES + 1;
protected:
static const char * PROPERTY_ROOT;
- void AddDevice( FGInputDevice * inputDevice );
+ unsigned AddDevice( FGInputDevice * inputDevice );
+ void RemoveDevice( unsigned index );
+
map<int,FGInputDevice*> input_devices;
FGDeviceConfigurationMap configMap;
+
+ SGPropertyNode_ptr nasalClose;
};
#endif