Double-click and right-click tools
Double-click and right-click by element or pixel.
Double-click and right-click by element or pixel.
| Tool | Description | Platforms |
|---|---|---|
double_click | Double-click at (x, y) or on an AX element identified by element_token. | macOS, Linux, Windows |
right_click | Right-click against a target pid. | macOS, Linux, Windows |
Served by cua-driver mcp; see MCP tools for every tool.
double_click#Effect: destructive. Platforms: macOS, Linux, Windows.
Double-click at (x, y) or on an AX element identified by element_token.
AX path (element_token provided): performs AXOpen when the element advertises it (Finder items, openable list rows/cells); otherwise resolves the element's on-screen center and falls back to a pixel double-click there.
Pixel path (x, y provided): two down/up pairs ~80 ms apart at the given coordinates.
macOS parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
delivery_mode | "background" | "foreground" | Best-effort-background ladder rung (default "background"). "background": inject without fronting or raising the target; no focus steal. "foreground": briefly front the target, act, then restore the prior frontmost; the explicit last resort when a background attempt didn't land. Re-call with "foreground" only for the action that needs it. | |
element_token | string | Opaque per-snapshot element handle from structuredContent.elements[].element_token. Returns an explicit stale error naming the current snapshots once a newer read supersedes it. | |
window_id | integer | CGWindowID. Omit when element_token is supplied (the token carries it). | |
x | number | Screen X coordinate (pixel path). | |
y | number | Screen Y coordinate (pixel path). |
Parameters on every platform
| Parameter | Type | Default | Description |
|---|---|---|---|
pid | integer | required | Target process ID. |
session | string | For multi-call work, prefer a short public session label and repeat it on every call that accepts it. Omit it to use the authenticated transport's implicit lifecycle session. |
Example arguments
{"pid":1}right_click#Effect: destructive. Platforms: macOS, Linux, Windows.
Right-click against a target pid. Two addressing modes:
element_token (from the last get_window_state snapshot): performs AXShowMenu on the cached element. Pure AX RPC, works on backgrounded / hidden windows, no cursor move or focus steal. Requires a prior get_window_state(pid, window_id) in this turn.
x, y: synthesizes rightMouseDown / rightMouseUp CGEvent pair posted to the pid. Driver converts image-pixel → screen-point internally. modifier forces the CGEvent path (AX actions don't propagate modifier keys).
Exactly one of element_token or (x AND y) must be provided. pid always required.
macOS parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
delivery_mode | "background" | "foreground" | Best-effort-background ladder rung (default "background"). "background": inject without fronting or raising the target; no focus steal. "foreground": briefly front the target, act, then restore the prior frontmost; the explicit last resort when a background attempt didn't land. Re-call with "foreground" only for the action that needs it. | |
element_token | string | Opaque per-snapshot element handle from structuredContent.elements[].element_token. Returns an explicit stale error naming the current snapshots once a newer read supersedes it. | |
modifier | string[] | Modifier keys held during the right-click: cmd/shift/option/ctrl. Pixel path only. | |
window_id | integer | CGWindowID. Omit when element_token is supplied (the token carries it). | |
x | number | X in window-local screenshot pixels. Must be provided together with y. | |
y | number | Y in window-local screenshot pixels. Must be provided together with x. |
Parameters on every platform
| Parameter | Type | Default | Description |
|---|---|---|---|
pid | integer | required | Target process ID. |
session | string | For multi-call work, prefer a short public session label and repeat it on every call that accepts it. Omit it to use the authenticated transport's implicit lifecycle session. |
Example arguments
{"pid":1}