+void FGInputDevice::Configure( SGPropertyNode_ptr aDeviceNode )
+{
+ deviceNode = aDeviceNode;
+
+ nasalModule = string("__event:") + GetName();
+
+ PropertyList eventNodes = deviceNode->getChildren( "event" );
+ for( PropertyList::iterator it = eventNodes.begin(); it != eventNodes.end(); it++ )
+ AddHandledEvent( FGInputEvent::NewObject( this, *it ) );
+
+ debugEvents = deviceNode->getBoolValue("debug-events", debugEvents );
+ grab = deviceNode->getBoolValue("grab", grab );
+
+ // TODO:
+ // add nodes for the last event:
+ // last-event/name [string]
+ // last-event/value [double]
+
+ SGPropertyNode_ptr nasal = deviceNode->getNode("nasal");
+ if (nasal) {
+ SGPropertyNode_ptr open = nasal->getNode("open");
+ if (open) {
+ const string s = open->getStringValue();
+ FGNasalSys *nas = (FGNasalSys *)globals->get_subsystem("nasal");
+ if (nas)
+ nas->createModule(nasalModule.c_str(), nasalModule.c_str(), s.c_str(), s.length(), deviceNode );
+ }
+ }
+
+}
+