Skip to content

Comments

Add missing double click extension methods and enhance mouse input APIs#279

Merged
Keboo merged 7 commits intomasterfrom
copilot/fix-192
Feb 6, 2026
Merged

Add missing double click extension methods and enhance mouse input APIs#279
Keboo merged 7 commits intomasterfrom
copilot/fix-192

Conversation

Copy link
Contributor

Copilot AI commented Jun 13, 2025

This PR enhances the double click APIs by adding missing extension methods and ensuring proper accessibility of the double click timing property.

Changes Made

New Extension Methods Added

  • RightDoubleClick() - Performs right mouse button double click
  • MiddleClick() - Performs middle mouse button single click
  • MiddleDoubleClick() - Performs middle mouse button double click

All new methods follow the same consistent API pattern as existing methods:

await element.RightDoubleClick(Position.Center, xOffset: 10, yOffset: 5);
await element.MiddleClick();
await element.MiddleDoubleClick(clickTime: TimeSpan.FromMilliseconds(200));

Enhanced Test Coverage

Added comprehensive tests for all new methods:

  • CanRightDoubleClickOnButton()
  • CanMiddleClickOnButton()
  • CanMiddleDoubleClickOnButton()
  • DoubleClickTimeIsAccessibleWithoutWinForms() - Verifies the double click timing property works without WinForms dependency

Requirements Fulfilled

Extension methods for double click - Now all mouse buttons support both single and double click operations (Left, Right, Middle)

Double click timing without WinForms - The MouseInput.GetDoubleClickTime property was already properly implemented using Windows API directly:

public static TimeSpan GetDoubleClickTime 
    => TimeSpan.FromMilliseconds(Windows.Win32.PInvoke.GetDoubleClickTime());

This avoids the WinForms dependency that would come from SystemInformation.DoubleClickTime.

API Consistency

The implementation maintains full consistency with existing patterns:

  • Same method signatures and parameter names
  • Same async/await patterns
  • Same return types (Task<Point>)
  • Same position and offset support
  • Same optional click timing support

Fixes #192.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Better double click APIs Add missing double click extension methods and enhance mouse input APIs Jun 13, 2025
Copilot AI requested a review from Keboo June 13, 2025 04:09
Copilot finished work on behalf of Keboo June 13, 2025 04:09
Copilot AI and others added 3 commits February 5, 2026 21:34
…thods with tests

Co-authored-by: Keboo <952248+Keboo@users.noreply.github.com>
Refactor: Updates `Assert.IsTrue` calls to `Assert.IsGreaterThan` and `Assert.IsNotEmpty` in mouse input tests. Also, relocates existing mouse input test methods within the file. (#192)
@Keboo Keboo marked this pull request as ready for review February 6, 2026 05:34
@Keboo Keboo enabled auto-merge (squash) February 6, 2026 05:34
@Keboo Keboo merged commit 56f245b into master Feb 6, 2026
3 checks passed
@Keboo Keboo deleted the copilot/fix-192 branch February 6, 2026 06:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Better double click APIs

2 participants