]> git.mxchange.org Git - flightgear.git/blobdiff - src/Input/input.hxx
throw an exception if not even a default joystick could be found;
[flightgear.git] / src / Input / input.hxx
index e2bcb9744ba4e982838ae561b9fca52c3d8fd35f..faad8acdc2462eef1cbeffd87325306118055b87 100644 (file)
@@ -33,6 +33,7 @@
 
 #include <simgear/compiler.h>
 
+#include <simgear/misc/sg_path.hxx>
 #include <simgear/structure/subsystem_mgr.hxx>
 #include <simgear/structure/commands.hxx>
 #include <simgear/props/condition.hxx>
@@ -53,6 +54,8 @@ SG_USING_STD(vector);
 
 #if defined( UL_WIN32 )
 #define TGT_PLATFORM   "windows"
+#elif defined ( UL_MAC_OSX )
+#define TGT_PLATFORM    "mac"
 #else
 #define TGT_PLATFORM   "unix"
 #endif
@@ -192,6 +195,8 @@ public:
   // Implementation of SGSubsystem.
   //
   virtual void init ();
+  virtual void reinit ();
+  virtual void postinit ();
   virtual void update (double dt);
   virtual void suspend ();
   virtual void resume ();
@@ -337,6 +342,9 @@ private:
     SGPropertyNode * mouse_button_nodes[MAX_MOUSE_BUTTONS];
     int nModes;
     int current_mode;
+    double timeout;
+    int save_x;
+    int save_y;
     mouse_mode * modes;
   };
 
@@ -353,6 +361,13 @@ private:
   void _init_joystick ();
 
 
+  /**
+   * Scan directory recursively for "named joystick" configuration files,
+   * and read them into /input/joysticks/js-named[index]++.
+   */
+  void _scan_joystick_dir (SGPath *path, SGPropertyNode* node, int *index);
+
+
   /**
    * Initialize mouse bindings.
    */
@@ -366,6 +381,11 @@ private:
                            button &b,
                            const string name);
 
+  /**
+   * Initialize nasal parts that had to wait for the nasal to get
+   * functional.
+   */
+  void _postinit_joystick ();
 
   /**
    * Update the keyboard.
@@ -382,7 +402,7 @@ private:
   /**
    * Update the mouse.
    */
-  void _update_mouse ();
+  void _update_mouse (double dt);
 
 
   /**