Tue, 03/01/2022 - 00:19
Forums:
Hello,
I've implemented mouse click operation mapper to Aspect_VKeyFlags's bitmasks below:
Aspect_VKeyMouse mouseButtonsToVirtualKeys (Qt::MouseButtons button)
{
Aspect_VKeyMouse button_ = Aspect_VKeyMouse_NONE;
if ((button & Qt::LeftButton) != 0)
{
button_ |= Aspect_VKeyMouse_MiddleButton;
}
if ((button & Qt::RightButton) != 0)
{
button_ |= Aspect_VKeyMouse_LeftButton;
}
return button_;
}
My intention was managing the rotation operations with Right-mouse click. However, I've lost to manage the AIS_ViewCube() with left mouse clicks according to above implementation. If I would like to manage the rotations with right-mouse click and AIS_ViewCube() clicking operations with left mouse click, how I can handle this implementation?
Should I use AIS_ViewCubeOwner class, or is there another method?
Thank you in advance!
Tue, 03/01/2022 - 10:04
You are trying to "fool" AIS_ViewController by swapping mouse buttons in events - this is not a good idea. Instead of swapping events it is better changing gesture map
Tue, 03/01/2022 - 20:20
These code samples help a lot and they are very useful. Many thank to you for information and detailed samples that include nearly all use-cases.
Tue, 03/01/2022 - 20:44
That not a sample - this is just a snippet copied from AIS_ViewController constructor with a couple of amendments. Don't be afraid to look into OCCT source code - it might bring many answers.