From 20914e49cd775065cbcff4df0ab6ed2ea3858a0a Mon Sep 17 00:00:00 2001
From: ThorstenB <brehmt@gmail.com>
Date: Fri, 12 Aug 2011 23:28:57 +0200
Subject: [PATCH] Tatsuhiro Nishioka: #403, scroll up/down for Mac OS Support
 osgViewer's Scroll_2D event (so far only available for Mac)

---
 src/Main/FGEventHandler.cxx | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/Main/FGEventHandler.cxx b/src/Main/FGEventHandler.cxx
index 5599723fa..91d830e6d 100644
--- a/src/Main/FGEventHandler.cxx
+++ b/src/Main/FGEventHandler.cxx
@@ -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;