]> git.mxchange.org Git - flightgear.git/commitdiff
Tatsuhiro Nishioka: #403, scroll up/down for Mac OS
authorThorstenB <brehmt@gmail.com>
Fri, 12 Aug 2011 21:28:57 +0000 (23:28 +0200)
committerThorstenB <brehmt@gmail.com>
Fri, 12 Aug 2011 21:28:57 +0000 (23:28 +0200)
Support osgViewer's Scroll_2D event (so far only available for Mac)

src/Main/FGEventHandler.cxx

index 5599723fa9228781a666630a8a0cebdadea4e01e..91d830e6dff1a561b9df7d1d4eb7a8b91e31b3d7 100644 (file)
@@ -205,7 +205,12 @@ bool FGEventHandler::handle(const osgGA::GUIEventAdapter& ea,
             return true;
 #endif
         int button;
-        if (ea.getScrollingMotion() == osgGA::GUIEventAdapter::SCROLL_UP)
+        if (ea.getScrollingMotion() == osgGA::GUIEventAdapter::SCROLL_2D) {
+            if (ea.getScrollingDeltaY() > 0)
+                button = 3;
+            else
+                button = 4;
+        } else if (ea.getScrollingMotion() == osgGA::GUIEventAdapter::SCROLL_UP)
             button = 3;
         else
             button = 4;