private void RenderOnDown(object sender, MouseEventArgs args) { Point p = GetMouse(args); MouseEventArgsExtended.MouseButtons b = MouseEventArgsExtended.MouseButtons.Empty; switch (((MouseButtonEventArgs)args).ChangedButton) { case MouseButton.Left: b = MouseEventArgsExtended.MouseButtons.Left; break; case MouseButton.Middle: b = MouseEventArgsExtended.MouseButtons.Middle; break; case MouseButton.Right: b = MouseEventArgsExtended.MouseButtons.Right; break; case MouseButton.XButton1: break; case MouseButton.XButton2: break; default: throw new ArgumentOutOfRangeException(); } MouseFired?.Invoke(new MouseEventArgsExtended(b, MouseEventArgsExtended.PressedState.Pressed, false, p.X, p.Y, 0)); }
private void RenderOnWheel(object sender, MouseEventArgs args) { var delta = ((MouseWheelEventArgs)args).Delta; _viewHeight += Math.Sign(delta) * 1; Point p = GetMouse(args); MouseFired?.Invoke(new MouseEventArgsExtended(MouseEventArgsExtended.MouseButtons.Empty, MouseEventArgsExtended.PressedState.Released, false, p.X, p.Y, delta)); }
private void RenderOnDoubleClick(object sender, MouseEventArgs args) { Point p = GetMouse(args); MouseEventArgsExtended.MouseButtons b = MouseEventArgsExtended.MouseButtons.Empty; if (((MouseButtonEventArgs)args).ChangedButton == MouseButton.Left) { b = MouseEventArgsExtended.MouseButtons.Left; } MouseFired?.Invoke(new MouseEventArgsExtended(b, MouseEventArgsExtended.PressedState.Released, true, p.X, p.Y, 0)); }
private void RenderOnClick(object sender, MouseEventArgs args) { Point p = GetMouse(args); MouseFired?.Invoke(new MouseEventArgsExtended(MouseEventArgsExtended.MouseButtons.Empty, MouseEventArgsExtended.PressedState.Released, false, p.X, p.Y, 0)); }