Add stateful pointer input#340
Open
zengfanfan wants to merge 1 commit into
Open
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add one consolidated
Pointertool for mouse-button gestures that need to span multiple MCP calls:The tool supports
down,move,up, andcancelactions. It tracks at most one held button, serializes state changes, releases input on movement/setup failures, and automatically releases held input after 30 seconds by default (maximum 120 seconds).cancelreleases left, right, and middle buttons for recovery, and normal server shutdown also clears tracked input.The existing
ClickandMoveinterfaces remain unchanged. This PR adds one public tool rather than separate mouse-down, mouse-move, mouse-up, and recovery tools.Motivation
Move(drag=True)is the right interface for an atomic drag that starts and finishes in one call. Some desktop workflows instead require multiple independently chosen path segments while a button remains held, such as free-form drawing or non-linear selection. Those workflows need explicit cross-call pointer state without overloading the existing statelessClickandMovecontracts.This complements the atomic explicit-start drag support merged in #328; it does not replace it.
Testing
ruff checkpassed for all changed Python files.ruff format --checkpassed for all changed Python files.71 passed.422 passed, 3 failed.tests/test_iserror_compliance.pyfor module-levelpowershell_tool,clipboard_tool, andregistry_toolsymbols.upstream/mainworktree atc46b8e4.down,move, andupevents in order, and the controller ended with no held button.Screenshots
Not applicable; this changes input behavior without adding UI.
Related Issues
None.