| 语法: |
Gesture.dispatch(path) |
|
| 参数 |
类型 |
说明 |
| path |
对象 |
路径对象 |
| return |
|
|
| 注意事项 |
仅使用无障碍模式下使用,其他模式无效 |
local gesture = Gesture:new() --创建一个手势滑动对象local path = Path:new() --创建一个轨迹路径path:setStartTime(100) --从触发事件的第100毫秒后开始滑动path:setDurTime(3000) --滑动的时间path:addPoint(100,500) --轨迹上的第一个点path:addPoint(500,500) --轨迹上的第二个点gesture:addPath(path) --添加一个路径function onFinishEvent(type) --执行结果回调函数 type为0执行完成,为1是执行中途被取消print("event:"..type) endlocal r = gesture:dispatch(onFinishEvent)-->开始执行手势动作if r thenprint("执行成功")elseprint("执行失败")endsleep(10000000)
💻进阶课程列表
💻YOLOv5课程列表
蜂群课堂-自动化教育