> For the complete documentation index, see [llms.txt](https://docs.gpmautomate.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gpmautomate.com/automate-zh/cao-zuo-zhi-nan/mouse/mouse-press-and-hold.md).

# 鼠标按住

鼠标按下并保持是指令鼠标指针执行按下左键并保持该状态（尚未释放）的操作。此操作通常不是独立存在的，而是作为模拟真实用户行为的复杂操作的起始步骤。

#### 按住位置配置：

与其他鼠标交互操作类似，您可以通过两种主要机制指定按住鼠标的位置：

* 按照 XPath：移动到网页上由 XPath 路径指定的元素的中心，然后按住。
* 按照坐标：移动到固定的像素点 x,y 或传递合并坐标的变量（例如变量 `$pos` 的形式为 `900,800`，从图像搜索操作中获得）以执行按住。

#### 实际应用：

当您想要执行拖放（Drag and Drop）操作序列时，此操作是必不可少的环节：

* 滑块验证码解码（Slider Captcha）：按住滑块（`Mouse press and hold`） ➔ 将鼠标移动到一个坐标 X 以匹配图像（`Mouse move`） ➔ 释放鼠标以完成验证（`Mouse release`）。
* 绘图或选择区域操作：在起始点按住，移动鼠标以扫描数据区域或在 Canvas/Game 应用程序上绘制直线，然后释放鼠标。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.gpmautomate.com/automate-zh/cao-zuo-zhi-nan/mouse/mouse-press-and-hold.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
