/// <summary> /// Presses the right button of the mouse at the current cursor position. /// </summary> public void PressRight() { var input = CreateInput(); input.Mouse.Flags = MouseFlags.RightDown; AWindowHelper.SendInput(input); }
/// <summary> /// Presses the middle button of the mouse at the current cursor position. /// </summary> public void PressMiddle() { var input = CreateInput(); input.Mouse.Flags = MouseFlags.MiddleDown; AWindowHelper.SendInput(input); }
/// <summary> /// Releases the right button of the mouse at the current cursor position. /// </summary> public void ReleaseRight() { var input = CreateInput(); input.Mouse.Flags = MouseFlags.RightUp; AWindowHelper.SendInput(input); }
/// <summary> /// Releases the middle button of the mouse at the current cursor position. /// </summary> public void ReleaseMiddle() { var input = CreateInput(); input.Mouse.Flags = MouseFlags.MiddleUp; AWindowHelper.SendInput(input); }
/// <summary> /// Scrolls vertically using the wheel of the mouse at the current cursor position. /// </summary> /// <param name="delta">The amount of wheel movement.</param> public void ScrollVertically(int delta = 120) { var input = CreateInput(); input.Mouse.Flags = MouseFlags.Wheel; input.Mouse.MouseData = delta; AWindowHelper.SendInput(input); }
/// <summary> /// Moves the cursor at the specified coordinate. /// </summary> /// <param name="x">The x-coordinate.</param> /// <param name="y">The y-coordinate.</param> protected void MoveToAbsolute(int x, int y) { var input = CreateInput(); input.Mouse.DeltaX = CalculateAbsoluteCoordinateX(x); input.Mouse.DeltaY = CalculateAbsoluteCoordinateY(y); input.Mouse.Flags = MouseFlags.Move | MouseFlags.Absolute; input.Mouse.MouseData = 0; AWindowHelper.SendInput(input); }