getUserSelection 方法提示用户从预定义列表中选择一个选项。当存在多个可选项时,此方法有助于收集用户输入。
要求
JSON-RPC 2.0TweezerComm 中的所有方法都遵循 JSON-RPC 2.0 结构。有关请求的结构和发送方式的更多详细信息,请参阅“入门指南” 。
method 字段设置为 getUserSelection,并按下方所示包含服务名称和参数。
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
getUserSelection 方法提示用户从预定义列表中选择一个选项。当存在多个可选项时,此方法有助于收集用户输入。
method 字段设置为 getUserSelection,并按下方所示包含服务名称和参数。
{
"jsonrpc":"2.0",
"method":"getUserSelection",
"id":"1234567890",
"params": [
"device",{
"title": "Choose item:",
"itemsKeys": ["1","2","3","4"],
"itemsValues": ["Option1","Option2","Option3","Option4"],
"timeout": 60
}
]
}
| 姓名 | 类型 | 描述 |
|---|---|---|
title | string | 要显示的主标题。 |
itemsKeys | 字符串数组 | 用作返回键的值。 |
itemsValues | 字符串数组 | 向用户展示的可见值。 |
timeout | 整数 | 超时时长(秒)。 |
{
"jsonrpc": "2.0",
"id": "1234567890",
"result": {
"statusCode": 0,
"selection": "1"
}
}
| 姓名 | 类型 | 描述 |
|---|---|---|
statusCode | 整数 | 操作状态(0 = 成功)。 |
statusMessage | string | 操作消息(可选)。 |
selection | string | 用户选择的键。 |
此页面对您有帮助吗?