protected virtual void OnKeyboardStartRotate(KeyRoutedEventArgs e) { var f = IsCtrlKeyPressed() ? 0.25f : 1; if (!IsShiftKeyPressed()) { switch (e.Key) { case VirtualKey.Left: OnAddRotationForce?.Invoke(Viewport, new AddForceEventArgs(new Vector2(-1 * f * (float)Viewport.LeftRightRotationSensitivity, 0))); e.Handled = true; break; case VirtualKey.Right: OnAddRotationForce?.Invoke(Viewport, new AddForceEventArgs(new Vector2(1 * f * (float)Viewport.LeftRightRotationSensitivity, 0))); e.Handled = true; break; case VirtualKey.Up: OnAddRotationForce?.Invoke(Viewport, new AddForceEventArgs(new Vector2(0, -1 * f * (float)Viewport.UpDownRotationSensitivity))); e.Handled = true; break; case VirtualKey.Down: OnAddRotationForce?.Invoke(Viewport, new AddForceEventArgs(new Vector2(0, 1 * f * (float)Viewport.UpDownRotationSensitivity))); e.Handled = true; break; } } }
protected void RaiseOnAddRotationForce(AddForceEventArgs args) { OnAddRotationForce?.Invoke(Viewport, args); }