Skip to content

Feature: Add relative mouse movement #16

@NakaokaRei

Description

@NakaokaRei

Description

Currently, swift-mcp-gui only supports absolute mouse positioning via moveMouse. SwiftAutoGUI also provides moveMouse(dx: Int, dy: Int) for relative mouse movement, which is useful for many automation scenarios.

Implementation Details

  • Add a new tool called moveMouseRelative or enhance existing moveMouse to support both modes
  • Accept parameters:
    • dx: Horizontal movement offset (positive = right, negative = left)
    • dy: Vertical movement offset (positive = down, negative = up)
  • Use SwiftAutoGUI's moveMouse(dx:dy:) method

Use Cases

  • Dragging operations
  • Incremental cursor adjustments
  • Gaming automation
  • Drawing/sketching automation
  • Gesture simulation

Example Usage

{
  "tool": "moveMouseRelative",
  "arguments": {
    "dx": 100,
    "dy": -50
  }
}

This would move the mouse 100 pixels to the right and 50 pixels up from its current position.

Alternative Design

Enhance the existing moveMouse tool to support both absolute and relative modes:

{
  "tool": "moveMouse",
  "arguments": {
    "mode": "relative",
    "dx": 100,
    "dy": -50
  }
}

Priority

Low - While useful, absolute positioning covers most use cases. Relative movement is more specialized.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions