Syntax
Description
Presses a mouse button at absolute screen coordinates without releasing it. Useful for manual drag operations or holding buttons for extended actions.Parameters
Absolute screen coordinates in format
x,y (e.g., 500,300). Coordinates are measured from the top-left corner of the primary display.Mouse button to press:
left- Primary buttonright- Secondary buttonmiddle- Middle button (scroll wheel)
Examples
Press left button
Press right button
Manual drag sequence
Press and hold for context menu
Use Cases
- Implement custom drag-and-drop with intermediate steps
- Hold button while moving cursor along specific path
- Simulate long-press gestures for context menus
- Multi-button sequences (hold one button, click another)
- Fine-grained control over mouse state timing
Related Commands
- mouse-up - Release the pressed button (required pair)
- mouse-move - Move cursor while button is held
- mouse-click - Complete press-release cycle
- drag - High-level drag operation
- wait - Pause between press and release