]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/FGManipulator.hxx
make isatty() available for stdout/stderr (hope it works on MS Windows)
[flightgear.git] / src / Main / FGManipulator.hxx
index 78fb8720200f84d756c8555f313f7cd458b2e3ff..cc1c5f5525fc91e33ade14a81fadb2c276d3885b 100644 (file)
@@ -4,9 +4,12 @@
 #include <map>
 #include <osg/Quat>
 #include <osgGA/MatrixManipulator>
+#include <osgViewer/ViewerEventHandlers>
 
 #include "fg_os.hxx"
 
+namespace flightgear
+{
 class FGManipulator : public osgGA::MatrixManipulator {
 public:
     FGManipulator();
@@ -103,6 +106,12 @@ public:
        {
            return currentModifiers;
        }
+
+    void setMouseWarped()
+       {
+           mouseWarped = true;
+       }
+
     void setPosition(const osg::Vec3d position) { this->position = position; }
     void setAttitude(const osg::Quat attitude) { this->attitude = attitude; }
 
@@ -120,15 +129,24 @@ protected:
     fgKeyHandler keyHandler;
     fgMouseClickHandler mouseClickHandler;
     fgMouseMotionHandler mouseMotionHandler;
+    osg::ref_ptr<osgViewer::StatsHandler> statsHandler;
+    osg::ref_ptr<osgGA::GUIEventAdapter> statsEvent;
+    int statsType;
     int currentModifiers;
-    // work-around for OSG bug
-    int osgModifiers;
-    typedef std::map<int, osgGA::GUIEventAdapter::ModKeyMask> KeyMaskMap;
-    KeyMaskMap keyMaskMap;
     std::map<int, int> numlockKeyMap;
     osg::Vec3d position;
     osg::Quat attitude;
     void handleKey(const osgGA::GUIEventAdapter& ea, int& key, int& modifiers);
     bool resizable;
+    bool mouseWarped;
+    // workaround for osgViewer double scroll events
+    bool scrollButtonPressed;
+    int release_keys[128];
+    void handleStats(osgGA::GUIActionAdapter& us);
 };
+
+void eventToWindowCoords(const osgGA::GUIEventAdapter* ea, double& x, double& y);
+void eventToWindowCoordsYDown(const osgGA::GUIEventAdapter* ea,
+                              double& x, double& y);
+}
 #endif