跳到主要内容

鼠标滑动

调用说明

  • 请求参数
参数类型说明备注
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数据字段说明