From b45e32afc986a176c04ee652219753dd09f1c236 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 28 Jan 2008 16:38:39 +0000 Subject: [PATCH] From Stephan Huber, added support for double click event for OSX. --- src/osgViewer/GraphicsWindowCarbon.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/osgViewer/GraphicsWindowCarbon.cpp b/src/osgViewer/GraphicsWindowCarbon.cpp index d5b24400f..60b27cce9 100644 --- a/src/osgViewer/GraphicsWindowCarbon.cpp +++ b/src/osgViewer/GraphicsWindowCarbon.cpp @@ -604,7 +604,7 @@ bool GraphicsWindowCarbon::realizeImplementation() setWindowDecoration(_traits->windowDecoration); useCursor(_traits->useCursor); - + // move the window to the right screen OSXCarbonWindowingSystemInterface* wsi = dynamic_cast(osg::GraphicsContext::getWindowingSystemInterface()); int screenLeft(0), screenTop(0); @@ -804,7 +804,8 @@ bool GraphicsWindowCarbon::handleMouseEvent(EventRef theEvent) } else { - + UInt32 clickCount; + GetEventParameter(theEvent, kEventParamClickCount, typeUInt32, NULL, sizeof(clickCount), NULL, &clickCount); // swap right and middle buttons so that middle button is 2, right button is 3. if (mouseButton==3) mouseButton = 2; else if (mouseButton==2) mouseButton = 3; @@ -862,7 +863,10 @@ bool GraphicsWindowCarbon::handleMouseEvent(EventRef theEvent) } } - getEventQueue()->mouseButtonPress(mx, my, mouseButton); + if (clickCount > 1) + getEventQueue()->mouseDoubleButtonPress(mx,my, mouseButton); + else + getEventQueue()->mouseButtonPress(mx, my, mouseButton); } break; case kEventMouseUp: @@ -1166,6 +1170,7 @@ void GraphicsWindowCarbon::setWindowName (const std::string& name) } + void GraphicsWindowCarbon::transformMouseXY(float& x, float& y) { if (getEventQueue()->getUseFixedMouseInputRange())