/// <summary> /// Function called when the mouse is moved while in raw input mode. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The <see cref="GI.GorgonMouseEventArgs" /> instance containing the event data.</param> private static void RawMouse_MouseMove(object sender, GI.GorgonMouseEventArgs e) { Point delta = e.RelativePosition; _cameraRotation.X += delta.Y.Sign() * (_sensitivity); _cameraRotation.Y += delta.X.Sign() * (_sensitivity); }
/// <summary> /// Handles the Up event of the Mouse control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="args">The <see cref="GI.GorgonMouseEventArgs"/> instance containing the event data.</param> private static void Mouse_Up(object sender, GI.GorgonMouseEventArgs args) { if (((args.Buttons & GI.MouseButtons.Right) != GI.MouseButtons.Right) || (_mouse == null)) { return; } try { _mouse.MouseButtonUp -= Mouse_Up; _mouse.MouseMove -= RawMouse_MouseMove; _input.UnregisterDevice(_mouse); _mouse = null; Cursor.Clip = Rectangle.Empty; GI.GorgonRawMouse.CursorVisible = true; } catch (Exception ex) { GorgonDialogs.ErrorBox(_window, ex); } }