cua_mouse
Controls the mouse in any macOS or Windows app through virtual input, enabling clicks, drags, and scrolling without moving the user's cursor or stealing focus.
Instructions
Zero-conflict Virtual Mouse v2.2 for ANY macOS or Windows software. Defaults to input_mode='virtual' (macOS CGEvent postToPid / Windows PostMessage to background HWND), so the user's physical mouse cursor and foreground focus are NEVER hijacked! Supports logical/normalized[0..1000]/image coords or element ref IDs, left/right/middle buttons, modifier-held smooth drags, triple-click, scroll, and saved_restore/physical fallbacks.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"action": "<action>"
},
"name": "cua_mouse"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | ||
| y | No | ||
| dx | No | ||
| dy | No | ||
| pid | No | Optional target process ID for virtual mouse routing. | |
| ref | No | Click/target numbered element [ref] from latest OCR/SoM/UI tree snapshot. | |
| hwnd | No | Optional Windows HWND handle for virtual mouse routing. | |
| to_x | No | ||
| to_y | No | ||
| steps | No | ||
| action | Yes | ||
| button | No | ||
| to_ref | No | ||
| app_name | No | Optional target app name for virtual mouse routing (auto-reuses last screenshot/UI-tree target app if omitted). | |
| modifiers | No | ||
| input_mode | No | 'virtual' (default, zero conflict with user's mouse/focus), 'saved_restore' (waits for user idle & restores cursor), or 'physical' (explicit foreground takeover). | virtual |
| coord_space | No | logical | |
| duration_ms | No |