Skip to main content
Some applications require more than a simple drag-and-drop. They need you to:
  • 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
The 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:
1

Press at start position

Use left_mouse_down with the starting coordinates to press and hold the mouse button.
2

Move to destination

Use mouse_move to drag to the target position while the button is held.
3

Wait at destination

Use wait to hold at the destination for the required duration.
4

Release

Use left_mouse_up to release 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:
1. Click on the item I want to drag
2. Use left_mouse_down at the item's position to start the drag
3. Use mouse_move to move to the drop target
4. Use wait for 2 seconds to hold at the target
5. Use left_mouse_up to release and complete the drop

When to Use

ScenarioSolution
Simple drag-and-dropUse left_click_drag with optional duration
Drag with hold at destinationUse left_mouse_downmouse_movewaitleft_mouse_up
Drag with multiple stopsChain multiple mouse_move and wait actions between down/up
Trigger hover states while draggingAdd wait actions at intermediate positions

Comparison with left_click_drag

The left_click_drag action is simpler and handles most drag operations:
left_click_drag from (100, 100) to (300, 300) with duration 0.5
This performs the entire drag in one action. The 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_down with left_mouse_up to avoid leaving the mouse in a pressed state
  • Use wait with 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_up to reset the mouse state before retrying