]> git.mxchange.org Git - flightgear.git/blobdiff - src/Input/input.cxx
GUI ‘restore defaults’ support.
[flightgear.git] / src / Input / input.cxx
index 6a36f9d806f0d87cb75d7a4fe661a60cc300cac7..55ea02d99e18e2a50be782257e5c14c51c82cd2b 100644 (file)
 #endif
 
 #include "input.hxx"
+
+#include <simgear/compiler.h>
+
+#include <Main/fg_props.hxx>
 #include "FGMouseInput.hxx"
 #include "FGKeyboardInput.hxx"
 #include "FGJoystickInput.hxx"
 
 #ifdef WITH_EVENTINPUT
+#if defined( SG_WINDOWS )
+//to be developed
+//#include "FGDirectXEventInput.hxx"
+//#define INPUTEVENT_CLASS FGDirectXEventInput
+#elif defined ( SG_MAC )
+#include "FGMacOSXEventInput.hxx"
+#define INPUTEVENT_CLASS FGMacOSXEventInput
+#else
 #include "FGLinuxEventInput.hxx"
+#define INPUTEVENT_CLASS FGLinuxEventInput
+#endif
+
 #endif
 
 ////////////////////////////////////////////////////////////////////////
 
 FGInput::FGInput ()
 {
-  set_subsystem( "input-mouse", new FGMouseInput() );
-  set_subsystem( "input-keyboard", new FGKeyboardInput() );
-  set_subsystem( "input-joystick", new FGJoystickInput() );
+  if( fgGetBool("/sim/input/no-mouse-input",false) ) {
+    SG_LOG(SG_INPUT,SG_ALERT,"Mouse input disabled!");
+  } else {
+    set_subsystem( "input-mouse", new FGMouseInput() );
+  }
+
+  if( fgGetBool("/sim/input/no-keyboard-input",false) ) {
+    SG_LOG(SG_INPUT,SG_ALERT,"Keyboard input disabled!");
+  } else {
+    set_subsystem( "input-keyboard", new FGKeyboardInput() );
+  }
+
+  if( fgGetBool("/sim/input/no-joystick-input",false) ) {
+    SG_LOG(SG_INPUT,SG_ALERT,"Joystick input disabled!");
+  } else {
+    set_subsystem( "input-joystick", new FGJoystickInput() );
+  }
+#ifdef INPUTEVENT_CLASS
+  if( fgGetBool("/sim/input/no-event-input",false) ) {
+    SG_LOG(SG_INPUT,SG_ALERT,"Event input disabled!");
+  } else {
+    set_subsystem( "input-event", new INPUTEVENT_CLASS() );
+  }
+#endif
 }
 
 FGInput::~FGInput ()