From e506bb30750a645ff5fc443b996bf45ff9838ca9 Mon Sep 17 00:00:00 2001 From: Friedrich Beckmann Date: Mon, 24 Oct 2016 19:54:43 +0200 Subject: [PATCH 1/2] added alternative to middle-mouse button in manipulator I added CTRL + RIGHT-MOUSE-CLICK to the standard manipulator as an alternative to MIDDLE-MOUSE-CLICK because a 3 Button Mouse not always available, e.g. on MacOS. I tested this with the osgAtlasSimbicon example. --- src/osgGA/StandardManipulator.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/osgGA/StandardManipulator.cpp b/src/osgGA/StandardManipulator.cpp index 61dfe17a2..b83dc3031 100644 --- a/src/osgGA/StandardManipulator.cpp +++ b/src/osgGA/StandardManipulator.cpp @@ -438,11 +438,14 @@ bool StandardManipulator::performMovement() // call appropriate methods unsigned int buttonMask = _ga_t1->getButtonMask(); + unsigned int ModKeyMask = _ga_t1->getModKeyMask(); if( buttonMask == GUIEventAdapter::LEFT_MOUSE_BUTTON ) { return performMovementLeftMouseButton( eventTimeDelta, dx, dy ); } else if( buttonMask == GUIEventAdapter::MIDDLE_MOUSE_BUTTON || + ( buttonMask == GUIEventAdapter::RIGHT_MOUSE_BUTTON && + ModKeyMask & GUIEventAdapter::MODKEY_CTRL ) || buttonMask == (GUIEventAdapter::LEFT_MOUSE_BUTTON | GUIEventAdapter::RIGHT_MOUSE_BUTTON) ) { return performMovementMiddleMouseButton( eventTimeDelta, dx, dy ); From 2f570ca3a949b7b30a3245e4167cf89b94bb1cc3 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 15 Nov 2016 11:16:03 +0000 Subject: [PATCH 2/2] Improved the indentation and case to make the code more consistent and readable --- src/osgGA/StandardManipulator.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/osgGA/StandardManipulator.cpp b/src/osgGA/StandardManipulator.cpp index b83dc3031..559405e67 100644 --- a/src/osgGA/StandardManipulator.cpp +++ b/src/osgGA/StandardManipulator.cpp @@ -438,15 +438,14 @@ bool StandardManipulator::performMovement() // call appropriate methods unsigned int buttonMask = _ga_t1->getButtonMask(); - unsigned int ModKeyMask = _ga_t1->getModKeyMask(); + unsigned int modKeyMask = _ga_t1->getModKeyMask(); if( buttonMask == GUIEventAdapter::LEFT_MOUSE_BUTTON ) { return performMovementLeftMouseButton( eventTimeDelta, dx, dy ); } - else if( buttonMask == GUIEventAdapter::MIDDLE_MOUSE_BUTTON || - ( buttonMask == GUIEventAdapter::RIGHT_MOUSE_BUTTON && - ModKeyMask & GUIEventAdapter::MODKEY_CTRL ) || - buttonMask == (GUIEventAdapter::LEFT_MOUSE_BUTTON | GUIEventAdapter::RIGHT_MOUSE_BUTTON) ) + else if( ( buttonMask == GUIEventAdapter::MIDDLE_MOUSE_BUTTON ) || + ( buttonMask == GUIEventAdapter::RIGHT_MOUSE_BUTTON && modKeyMask & GUIEventAdapter::MODKEY_CTRL ) || + ( buttonMask == (GUIEventAdapter::LEFT_MOUSE_BUTTON | GUIEventAdapter::RIGHT_MOUSE_BUTTON) ) ) { return performMovementMiddleMouseButton( eventTimeDelta, dx, dy ); }