Skip to content

Commit

Permalink
slightly improve code documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
striezel committed Oct 21, 2024
1 parent ef2c3d5 commit 4e1b4b5
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions mouse-click-simulator/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,10 @@ private void AdjustClickCoordinatesToWindowRectangle(WinApi.RECT rectangle)
/// <summary>
/// Simulates a mouse click on a window.
/// </summary>
/// <param name="window">the target window to click onto.</param>
/// <param name="window">the target window to click onto</param>
/// <param name="coordinates">encoded coordinates for the click</param>
/// <param name="button">the mouse button to click</param>
/// <param name="button">the mouse button to click (only left, right
/// and middle mouse button are supported)</param>
private static void SimulateMouseClick(WindowData window, IntPtr coordinates, MouseButtons button)
{
switch (button)
Expand All @@ -251,6 +252,13 @@ private static void SimulateMouseClick(WindowData window, IntPtr coordinates, Mo
}


/// <summary>
/// Simulates a mouse click on a window, in an asynchronous manner.
/// </summary>
/// <param name="window">the target window to click onto</param>
/// <param name="coordinates">encoded coordinates for the click</param>
/// <param name="button">the mouse button to click (only left, right
/// and middle mouse button are supported)</param>
private static void SimulateMouseClickAsync(WindowData window, IntPtr coordinates, MouseButtons button)
{
switch (button)
Expand All @@ -277,6 +285,11 @@ private static void SimulateMouseClickAsync(WindowData window, IntPtr coordinate
}


/// <summary>
/// Triggers emission of click event messages, in an asynchronous manner.
/// </summary>
/// <param name="window">the target window to click onto</param>
/// <param name="coordinates">encoded coordinates for the click</param>
private void EmitClickEventsAsync(WindowData window, IntPtr coordinates)
{
if (cbLeftMouseButton.Checked)
Expand All @@ -294,6 +307,11 @@ private void EmitClickEventsAsync(WindowData window, IntPtr coordinates)
}


/// <summary>
/// Triggers emission of click event messages.
/// </summary>
/// <param name="window">the target window to click onto</param>
/// <param name="coordinates">encoded coordinates for the click</param>
private void EmitClickEventsSync(WindowData window, IntPtr coordinates)
{
if (cbLeftMouseButton.Checked)
Expand Down

0 comments on commit 4e1b4b5

Please sign in to comment.