diff --git a/src/Input/FGMouseInput.cxx b/src/Input/FGMouseInput.cxx index 879fe3dfd..ea29d8de8 100644 --- a/src/Input/FGMouseInput.cxx +++ b/src/Input/FGMouseInput.cxx @@ -704,3 +704,13 @@ bool FGMouseInput::isRightDragToLookEnabled() const return (d->rightClickModeCycle == false); } + +bool FGMouseInput::isActiveModePassThrough() const +{ + if (!d) { + return false; + } + + mouse &m = d->mice[0]; + return m.modes[m.current_mode].pass_through; +} diff --git a/src/Input/FGMouseInput.hxx b/src/Input/FGMouseInput.hxx index acf1c2ffa..989a2267a 100644 --- a/src/Input/FGMouseInput.hxx +++ b/src/Input/FGMouseInput.hxx @@ -59,6 +59,11 @@ public: * @return */ bool isRightDragToLookEnabled() const; + + /** + * @brief check if the active mode passes clicks through to the UI or not + */ + bool isActiveModePassThrough() const; private: void processMotion(int x, int y, const osgGA::GUIEventAdapter* ea); diff --git a/src/Viewer/PUICamera.cxx b/src/Viewer/PUICamera.cxx index eea14b77d..590db5fca 100644 --- a/src/Viewer/PUICamera.cxx +++ b/src/Viewer/PUICamera.cxx @@ -164,10 +164,7 @@ public: case(osgGA::GUIEventAdapter::RELEASE): { FGMouseInput* mouseSubsystem = globals->get_subsystem()->get_subsystem(); - if (mouseSubsystem && - mouseSubsystem->isRightDragToLookEnabled() && - _mouse0RightButtonNode->getBoolValue()) - { + if (mouseSubsystem && !mouseSubsystem->isActiveModePassThrough()) { return false; }