Fix for RMB/MMB interaction with picking
When RMB drag-to-look is active, ignore all other mouse downs, which might otherwise trigger picks to start. Ticket-Id: https://sourceforge.net/p/flightgear/codetickets/2108/
This commit is contained in:
parent
6512783996
commit
f4298d676f
2 changed files with 24 additions and 4 deletions
|
@ -551,6 +551,12 @@ void FGMouseInput::doMouseClick (int b, int updown, int x, int y, bool mainWindo
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isRightDragLookActive() && (updown == MOUSE_BUTTON_DOWN)) {
|
||||||
|
// when spring-loaded mode is active, don't do scene selection for picks
|
||||||
|
// https://sourceforge.net/p/flightgear/codetickets/2108/
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Pass on to PUI and the panel if
|
// Pass on to PUI and the panel if
|
||||||
// requested, and return if one of
|
// requested, and return if one of
|
||||||
// them consumes the event.
|
// them consumes the event.
|
||||||
|
@ -619,13 +625,11 @@ void FGMouseInput::processMotion(int x, int y, const osgGA::GUIEventAdapter* ea)
|
||||||
|
|
||||||
mouse &m = d->mice[0];
|
mouse &m = d->mice[0];
|
||||||
int modeIndex = m.current_mode;
|
int modeIndex = m.current_mode;
|
||||||
// are we in spring-loaded look mode?
|
|
||||||
if (!d->rightClickModeCycle && m.nModes > 3) {
|
if (isRightDragLookActive()) {
|
||||||
if (m.mouse_button_nodes[2]->getBoolValue()) {
|
|
||||||
// right mouse is down, force look mode
|
// right mouse is down, force look mode
|
||||||
modeIndex = 3;
|
modeIndex = 3;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (modeIndex == 0) {
|
if (modeIndex == 0) {
|
||||||
osg::Vec2d windowPos;
|
osg::Vec2d windowPos;
|
||||||
|
@ -725,6 +729,20 @@ bool FGMouseInput::isActiveModePassThrough() const
|
||||||
return m.modes[mode].pass_through;
|
return m.modes[mode].pass_through;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool FGMouseInput::isRightDragLookActive() const
|
||||||
|
{
|
||||||
|
if (!d) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
const auto& m = d->mice[0];
|
||||||
|
if (!d->rightClickModeCycle && m.nModes > 3) {
|
||||||
|
return m.mouse_button_nodes[2]->getBoolValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Register the subsystem.
|
// Register the subsystem.
|
||||||
SGSubsystemMgr::Registrant<FGMouseInput> registrantFGMouseInput;
|
SGSubsystemMgr::Registrant<FGMouseInput> registrantFGMouseInput;
|
||||||
|
|
|
@ -72,6 +72,8 @@ public:
|
||||||
private:
|
private:
|
||||||
void processMotion(int x, int y, const osgGA::GUIEventAdapter* ea);
|
void processMotion(int x, int y, const osgGA::GUIEventAdapter* ea);
|
||||||
|
|
||||||
|
bool isRightDragLookActive() const;
|
||||||
|
|
||||||
class FGMouseInputPrivate;
|
class FGMouseInputPrivate;
|
||||||
std::unique_ptr<FGMouseInputPrivate> d;
|
std::unique_ptr<FGMouseInputPrivate> d;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue