X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FInput%2FFGEventInput.hxx;h=973821bd0584452c7bb10a8ecfc3ed3edc150aa5;hb=11d15b451347674fba77648700d23c5aaec3c6c2;hp=7a7323d4370dd5a5903a0344a5abb1c7348b20fd;hpb=5c57153e6233a112fa3aec8fd648a1a7d8743099;p=flightgear.git diff --git a/src/Input/FGEventInput.hxx b/src/Input/FGEventInput.hxx index 7a7323d43..973821bd0 100644 --- a/src/Input/FGEventInput.hxx +++ b/src/Input/FGEventInput.hxx @@ -33,7 +33,7 @@ * To be extended for O/S specific implementation data */ struct FGEventData { - FGEventData( double aValue, double aDt, int aModifiers ) : value(aValue), dt(aDt), modifiers(aModifiers) {} + FGEventData( double aValue, double aDt, int aModifiers ) : modifiers(aModifiers), value(aValue), dt(aDt) {} int modifiers; double value; double dt; @@ -164,7 +164,7 @@ typedef class SGSharedPtr FGInputEvent_ptr; */ class FGInputDevice : public SGReferenced { public: - FGInputDevice() {} + FGInputDevice() : debugEvents(false), grab(false) {} FGInputDevice( string aName ) : name(aName) {} virtual ~FGInputDevice(); @@ -191,14 +191,33 @@ public: handledEvents[handledEvent->GetName()] = handledEvent; } + virtual void Configure( SGPropertyNode_ptr deviceNode ); + virtual void update( double dt ); + bool GetDebugEvents () const { return debugEvents; } + + bool GetGrab() const { return grab; } + + const string & GetNasalModule() const { return nasalModule; } + private: // A map of events, this device handles map handledEvents; // the device has a name to be recognized string name; + + // 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_ptr; @@ -215,12 +234,18 @@ public: 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 input_devices; FGDeviceConfigurationMap configMap; + + SGPropertyNode_ptr nasalClose; }; #endif