鼠标滑动
调用说明
- 请求参数
参数 | 类型 | 说明 | 备注 |
---|---|---|---|
fun | 字符串 | /mouse/swipe | 请求功能名 |
id | 字符串 | 设备唯一ID | 多个设备用逗号隔开 |
button | 字符串 | 1左键,2右键 | 为空默认左键 |
direction | 整数 | 滑动方向up,down,left,right | 分别对应上下左右 |
len | 浮点数 | 滑动距离百分比 | 假设0.9会从屏幕10%滑动到90% |
step_sleep | 整数 | 当steping大于1生效 | 多次滑动每次间隔时间毫秒 |
steping | 整数 | 循环多少次滑动到指定位置 | - |
brake | 整数 | 滑动完了立即停止 | 再有些界面滑完可能会误点 |
sx | 整数 | y坐标 | 0使用滑动距离百分比自动计算的 |
sy | 整数 | y坐标 | 0使用滑动距离百分比自动计算的 |
ex | 整数 | y坐标 | 0使用滑动距离百分比自动计算的 |
ey | 整数 | y坐标 | 0使用滑动距离百分比自动计算的 |
- httpGet请求示例
curl --request GET \
--url 'http://192.168.9.9:9911/api/mouse/swipe?id=1C:5C:F2:BC:D0:CC&direction=up&len=0.9'
- httpPost请求示例
curl --request POST \
--url http://192.168.9.9:9911/api \
--header 'content-type: multipart/form-data' \
--form fun=/mouse/swipe \
--form id=1C:5C:F2:BC:D0:CC \
--form direction=up \
--form len=0.8
- httpPost json请求示例【websocket也可发送同样json请求】
curl --request POST \
--url http://192.168.9.9:9911/api \
--header 'Content-Type: application/json' \
--data '{
"fun": "/mouse/swipe",
"msgid": 1,
"data": {
"id": "1C:5C:F2:BC:D0:CC",
"direction": "up",
"len": 0.9,
"steping": 10,
"step_sleep": 10,
"brake": true,
"sx": 100,
"ex": 100
}
}'
{ "fun": "/mouse/swipe", "msgid": 2, "data": { "id": "0C:51:01:0B:E5:EA", "button": "left", "direction": "left", "steping": 0, "step_sleep": 0, "brake": true, "sx": 100, "sy": 100, "ex": 100, "ey": 100 } }
响应结果
{
"data": {
"code": 0,
"id": "5C:F7:E6:CE:65:22",
"message": "成功"
},
"status": 200,
"message": "成功",
"msgid": 0,
"fun": "/mouse/swipe"
}
- 响应data数据字段说明
无