> For AI agents: the complete documentation index is available at /apps-plugin/docs/llms.txt, the full documentation bundle is available at /apps-plugin/docs/llms-full.txt.

# onUserCaptureScreen

监听用户主动截屏事件。

## 扫码预览

![扫码预览 onUserCaptureScreen](https://api.qrserver.com/v1/create-qr-code/?size=200x200\&data=doubao%3A%2F%2Fdoubao_apps%3Fapp_id%3Ddb_1McM5Ni%26path%3D%252Fpages%252Fapi%252Fdevice%252Fon-user-capture-screen%252Findex)

## 支持版本

前端库版本不低于 `0.0.26`。

## 支持平台

<table>
<thead>
<tr><th>平台</th><th>支持情况</th></tr>
</thead>
<tbody>
<tr><td>Android</td><td>支持</td></tr>
<tr><td>iOS</td><td>支持</td></tr>
<tr><td>PC</td><td>不支持</td></tr>
<tr><td>HarmonyOS</td><td>不支持</td></tr>
</tbody>
</table>

## 支持场景

<table>
<thead>
<tr><th>场景</th><th>支持情况</th></tr>
</thead>
<tbody>
<tr><td>页面</td><td>支持</td></tr>
<tr><td>卡片</td><td>不支持</td></tr>
</tbody>
</table>

## 使用说明

- 事件不携带截图内容，仅通知发生了截屏

## 调用方式

### 事件监听 API

```typescript
onUserCaptureScreen(callback: (event: UserCaptureScreenEvent) => void): () => void
```

## 入参

无。

## 调用示例

```ts
import { onUserCaptureScreen } from '@doubao-dev/framework/api';

const off = onUserCaptureScreen(() => {
  console.log('用户截屏了');
});

off();
```

## 回调参数

无。

## 返回值

无返回字段。

### 回调示例

```json
{}
```
