- Hold at the destination before releasing (e.g., drag-to-reorder with hover delay)
- Pause mid-drag to trigger hover states or tooltips
- Perform multi-step drag sequences with precise timing
left_mouse_down and left_mouse_up actions give you granular control over the mouse button state, enabling these complex drag patterns.
Available Actions
left_mouse_down
Press and hold the left mouse button without releasing. Optionally move to coordinates first.
left_mouse_up
Release a previously pressed left mouse button. Optionally move to coordinates first.
Basic Usage Pattern
To perform a drag with a hold duration at the destination:Press at start position
Use
left_mouse_down with the starting coordinates to press and hold the mouse button.Example: Drag with 2-Second Hold
Here’s an example workflow prompt that drags an element and holds for 2 seconds before releasing:When to Use
| Scenario | Solution |
|---|---|
| Simple drag-and-drop | Use left_click_drag with optional duration |
| Drag with hold at destination | Use left_mouse_down → mouse_move → wait → left_mouse_up |
| Drag with multiple stops | Chain multiple mouse_move and wait actions between down/up |
| Trigger hover states while dragging | Add wait actions at intermediate positions |
Comparison with left_click_drag
Theleft_click_drag action is simpler and handles most drag operations:
duration parameter controls how long the movement takes, not how long to hold at the destination.
For scenarios requiring a hold at the destination, use the manual approach with left_mouse_down and left_mouse_up.
The
left_mouse_down and left_mouse_up actions are available in both the main agent and focused agent contexts.Tips
- Always pair
left_mouse_downwithleft_mouse_upto avoid leaving the mouse in a pressed state - Use
waitwith specific durations (e.g., 1-3 seconds) for hover triggers - Take screenshots between actions if you need to verify the drag state
- If a drag fails, the agent can use
left_mouse_upto reset the mouse state before retrying