Skip to content

Commit

Permalink
Implemented MouseMoveRelative method. (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
StrajnarFilip authored Aug 19, 2024
1 parent d25e1ba commit d98cb96
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Desktop.Robot/IRobot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,19 @@ public interface IRobot
void MouseScroll(int value, TimeSpan duration);
void MouseScroll(int value, TimeSpan duration, int steps);
Point GetMousePosition();

/// <summary>
/// Moves the mouse by a given amount from the current position.
/// The <paramref name="x"/> and <paramref name="y"/> values are added to the current coordinates.
/// </summary>
/// <param name="x">X value added to the current X position.</param>
/// <param name="y">Y value added to the current Y position.</param>
void MouseMoveRelative(int x, int y)
{
Point currentPoint = GetMousePosition();
currentPoint.X += x;
currentPoint.Y += y;
MouseMove(currentPoint);
}
}
}

0 comments on commit d98cb96

Please sign in to comment.