Thu, 04/03/2025 - 15:56
Forums:
I'm trying to unbind the left-hand mouse button, but can't seem to get it to un-function! From my AIS_ViewController descendant class...
myMouseGestureMap.Clear();
myMouseGestureMap.UnBind(Aspect_VKeyMouse_LeftButton);
myMouseGestureMap.UnBind(Aspect_VKeyMouse_RightButton);
myMouseGestureMap.Bind(Aspect_VKeyMouse_MiddleButton, AIS_MouseGesture_RotateOrbit);
running up the code still has the left button performing rotation (looks like AIS_MouseGesture_RotateView)
Also tried...
myMouseGestureMap.Bind(Aspect_VKeyMouse_LeftButton, AIS_MouseGesture_NONE);
but doesn't make any difference.
This is fed into the mouse handler:
void occView::mousePressEvent(QMouseEvent* event)
{
Graphic3d_Vec2i point;
point.SetValues(event->position().x(), event->position().y());
const Aspect_VKeyFlags flags = qtMouseModifiers2VKeys (event->modifiers());
if (!_view.IsNull() && UpdateMouseButtons(point, qtMouseButtons2VKeys (event->buttons()), flags, false))
updateView();
_clickPos = point;
}
Can someone check my sanity here, or does this look like a bug?
Fri, 04/04/2025 - 07:08
There is another gesture map
myMouseGestureMapDragdefining mouse buttons combination for dragging objects.AIS_ViewControllerconstructor defines it to left mouse button:As both dragging and rotation initiated by the same mouse gesture, these two conflict with each other and
AIS_ViewControllerperforms special treatment to try handling dragging first and then falling back to rotation if dragging event has been rejected by the object. Apparently, there is a bug in this logic, so that rotation is initiated by draggingmyMouseGestureMapDrag, even when rotation gesture hasn't been assigned to the same mouse button inmyMouseGestureMap.So, to clean up all mouse gestures, clean up both maps:
Note, that if you just want disabling view rotation by any gesture (temporarily),
AIS_ViewController::SetAllowRotation(false)would be more convenient (and it doesn't trigger the same bug with the dragging gesture).Fri, 04/04/2025 - 19:44
Sorted, thanks - disabling the second one did the trick