【REST API】操作屏幕类[Inputs]-操作屏幕类[Inputs]

描述:

发送点击事件,对坐标 (x, y) 进行点击操作(按下/弹起/滑动/点击)。

对应JS API:


var device = Device.getMain();
device.click(, , );

是否支持多设备:

支持

请求方式:

POST
http://IP:8090/TotalControl/v1/devices/:device/screen/inputs

参数:

参数名 类型 必选 描述
token string Y Total Control TOKEN
:device string Y 主控设备对象值 id
x int Y x 坐标
y int Y y 坐标
state string N 状态值(缺省press)
-down 按下
-up 弹起
-move 移动
-press 点击(按下+弹起)

请求示例:


示例一:
http://127.0.0.1:8090/TotalControl/v1/devices/device@1116106541/screen/inputs?token=270eq7lXQK8bXYsJ&x=100&y=200&state=press

示例二:
http://127.0.0.1:8090/TotalControl/v1/devices/device@1116106541/screen/inputs
{
    "token":"270eq7lXQK8bXYsJ",
    "x":100,
    "y":200,
    "state":"press"
}

返回示例:


{
    "status":true
}

返回字段说明:

字段 类型 描述
status boolean true:成功; false:失败

猜你喜欢

转载自blog.csdn.net/lemon5814/article/details/83149838