Fix PUI mouse for non-pass-through mouse modes
As reported by Michael Danilov, ensure sticky mouse modes for view and flight controls don’t send button events to PUI
This commit is contained in:
parent
6f5fa7a3c0
commit
8986abeb52
3 changed files with 16 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -164,10 +164,7 @@ public:
|
|||
case(osgGA::GUIEventAdapter::RELEASE):
|
||||
{
|
||||
FGMouseInput* mouseSubsystem = globals->get_subsystem<FGInput>()->get_subsystem<FGMouseInput>();
|
||||
if (mouseSubsystem &&
|
||||
mouseSubsystem->isRightDragToLookEnabled() &&
|
||||
_mouse0RightButtonNode->getBoolValue())
|
||||
{
|
||||
if (mouseSubsystem && !mouseSubsystem->isActiveModePassThrough()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue