public virtual void MouseDown(Point startPoint, MouseButton mouseButton) { if (mouseButton == MouseButton.Left) { leftClick = true; } }
private static System.Windows.Input.MouseButton WinFormToWPFMouseButton(System.Windows.Forms.MouseEventArgs e) { System.Windows.Input.MouseButton btn = System.Windows.Input.MouseButton.Left; switch (e.Button) { case System.Windows.Forms.MouseButtons.Left: btn = System.Windows.Input.MouseButton.Left; break; case System.Windows.Forms.MouseButtons.Middle: btn = System.Windows.Input.MouseButton.Middle; break; case System.Windows.Forms.MouseButtons.Right: btn = System.Windows.Input.MouseButton.Right; break; case System.Windows.Forms.MouseButtons.XButton1: btn = System.Windows.Input.MouseButton.XButton1; break; case System.Windows.Forms.MouseButtons.XButton2: btn = System.Windows.Input.MouseButton.XButton2; break; } return(btn); }
public MouseEventArgs(System.Windows.Input.MouseButton button, int clicks, int x, int y, int delta) { this.Button = button; this.Clicks = clicks; this.X = x; this.Y = y; this.Delta = delta; }
public override void MouseDown(Point startPoint, MouseButton mouseButton) { base.MouseDown(startPoint, mouseButton); line.StartPoint = startPoint; line.EndPoint = startPoint; line.Thickness = Configurator.Thickness; line.Outline = Configurator.Outline; }
public static MouseButtons ToMouseButton(this System.Windows.Input.MouseButton button) { switch (button) { case System.Windows.Input.MouseButton.Middle: return(MouseButtons.Middle); case System.Windows.Input.MouseButton.Right: return(MouseButtons.Right); default: return(MouseButtons.Left); } }
protected static GeneralMouseButtons GetMouseButton(System.Windows.Input.MouseButton state) { switch (state) { case System.Windows.Input.MouseButton.Left: return(GeneralMouseButtons.Left); case System.Windows.Input.MouseButton.Right: return(GeneralMouseButtons.Right); } return(GeneralMouseButtons.None); }
/// <summary> /// Mouse up event /// </summary> /// <param name="x"></param> /// <param name="y"></param> /// <param name="button"></param> public void MouseUp(double x, double y, int button) { System.Windows.Input.MouseButton btn = (System.Windows.Input.MouseButton)Enum.Parse(typeof(System.Windows.Input.MouseButton), button.ToString()); Point absolutePoint = ConvertPointToAbsolute(new Point(x, y)); underlyingMouseSimulator.MoveMouseTo(absolutePoint.X, absolutePoint.Y); if (btn == System.Windows.Input.MouseButton.Left) { underlyingMouseSimulator.LeftButtonUp(); } else if (btn == System.Windows.Input.MouseButton.Right) { underlyingMouseSimulator.RightButtonUp(); } }
private static MouseButton ConvertMouseButton(System.Windows.Input.MouseButton mouseButton) { switch (mouseButton) { case System.Windows.Input.MouseButton.Left: return(MouseButton.Left); case System.Windows.Input.MouseButton.Right: return(MouseButton.Right); case System.Windows.Input.MouseButton.Middle: return(MouseButton.Middle); case System.Windows.Input.MouseButton.XButton1: return(MouseButton.Extended1); case System.Windows.Input.MouseButton.XButton2: return(MouseButton.Extended2); } return((MouseButton)(-1)); }