Overview
Mouse control enables:- Clicking buttons and UI elements
- Moving cursor to specific positions
- Dragging and dropping elements
- Scrolling windows and content
Desktop automation requires a template with desktop support. Ensure your sandbox has desktop capabilities enabled.
Clicking
Click at a specific position on the screen:- Python
- JavaScript
Moving Cursor
Move the mouse cursor to a specific position:- Python
- JavaScript
Dragging
Drag from one position to another:- Python
- JavaScript
Scrolling
Scroll the mouse wheel:- Python
- JavaScript
Mouse Buttons
Available mouse buttons:"left"- Left mouse button (default)"right"- Right mouse button"middle"- Middle mouse button (scroll wheel)
Complete Example
Automate a simple GUI interaction:- Python
- JavaScript
Coordinate System
Mouse coordinates use screen pixels:- Origin (0, 0): Top-left corner of the screen
- X-axis: Increases from left to right
- Y-axis: Increases from top to bottom
Related
- Keyboard Control - Control keyboard input
- CLI Reference - Command-line interface for HopX
- Screenshots - Capture screenshots to find coordinates
- X11 Advanced - Find elements by text
- SDK: sandbox.desktop.click() - Python SDK method
Next Steps
- Learn about Keyboard Control for text input
- Explore Screenshots to find element coordinates
- Review VNC Server for remote desktop access

