From 0891e011dcafd2fcf85c4a184b880301cccea9c9 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 19 Nov 2009 17:22:20 +0000 Subject: [PATCH] From Vincent Gadoury, "In osgViewer::Viewer and osgViewer::CompositveViewer, the DOUBLECLICK event type was not considered as a "pointer event" and thus was receiving the event state coordinates and button mask. As a result, a double-click event always had a button mask not including the double-clicked button, even if double-click event is a "button push" event. The modification consists only in including osgGA::GUIEventAdapter::DOUBLECLICK in the list of "pointerEvent" events. Test done to reproduce the problem and check the fix: in any osg application or example with an HandleInput function, break on events with a double-click event type. Without the changes, the event's buttonMask does not contain the double-clicked button. With the changes, it does. Only simple tests (running some examples and playing with the mouse) were done to check that the changes do not break anything, since double-click is not used thoroughly in OSG. Modification done against current SVN Trunk version (r10753). As this is a fix, I do not wish to keep my copyright on this submission and assign it over to the project lead. " --- src/osgViewer/CompositeViewer.cpp | 1 + src/osgViewer/Viewer.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/osgViewer/CompositeViewer.cpp b/src/osgViewer/CompositeViewer.cpp index 648c20390..a786b491b 100644 --- a/src/osgViewer/CompositeViewer.cpp +++ b/src/osgViewer/CompositeViewer.cpp @@ -739,6 +739,7 @@ void CompositeViewer::eventTraversal() break; case(osgGA::GUIEventAdapter::PUSH): case(osgGA::GUIEventAdapter::RELEASE): + case(osgGA::GUIEventAdapter::DOUBLECLICK): case(osgGA::GUIEventAdapter::DRAG): case(osgGA::GUIEventAdapter::MOVE): { diff --git a/src/osgViewer/Viewer.cpp b/src/osgViewer/Viewer.cpp index 5d5128e8c..a05432891 100644 --- a/src/osgViewer/Viewer.cpp +++ b/src/osgViewer/Viewer.cpp @@ -655,6 +655,7 @@ void Viewer::eventTraversal() { case(osgGA::GUIEventAdapter::PUSH): case(osgGA::GUIEventAdapter::RELEASE): + case(osgGA::GUIEventAdapter::DOUBLECLICK): case(osgGA::GUIEventAdapter::DRAG): case(osgGA::GUIEventAdapter::MOVE): {