MouseCameraController rotation with left button pressed OR with right button pressed
#2
With using PreviewMouseDown event it is possible to check which button is pressed before this event gets processed by the MouseCameraController. This means that it is possible to update the RotateCameraConditions based on the currently pressed mouse button:

            ViewportBorder.PreviewMouseDown += delegate(object sender, MouseButtonEventArgs e)
            {
                if (e.LeftButton == MouseButtonState.Pressed && e.RightButton == MouseButtonState.Released)
                {
                    MouseCameraController1.RotateCameraConditions = MouseCameraController.MouseAndKeyboardConditions.LeftMouseButtonPressed;
                }
                else if (e.LeftButton == MouseButtonState.Released && e.RightButton == MouseButtonState.Pressed)
                {
                    MouseCameraController1.RotateCameraConditions = MouseCameraController.MouseAndKeyboardConditions.RightMouseButtonPressed;
                }
                else if (e.LeftButton == MouseButtonState.Pressed && e.RightButton == MouseButtonState.Pressed)
                {
                    MouseCameraController1.RotateCameraConditions = MouseCameraController.MouseAndKeyboardConditions.LeftMouseButtonPressed | MouseCameraController.MouseAndKeyboardConditions.RightMouseButtonPressed;
                }
            };

With the new version of Ab3d.PowerToys (I am planning to release it this week or in the beginning of the next week) it will be also possible to override the IsMouseButtonsConditionTrue and IsKeyboardConditionTrue methods and provide your own logic there.
Andrej Benedik
  


Messages In This Thread
RE: MouseCameraController rotation with left button pressed OR with right button pressed - by abenedik - 02-13-2019, 10:22 AM

Forum Jump:


Users browsing this thread:
1 Guest(s)