跳到正文

AndroidInput ​

添加于: v1.9

方法 ​

androidInput.drag() ​

添加于: v1.9 异步

在 from 和 to 两点之间执行拖拽操作。

参数

  • from Object

    拖拽的起始点。

    • x float
    • y float
  • to Object

    拖拽的终点。

    • x float
    • y float
  • steps int

    拖拽的步数。每一步需要 5 毫秒完成。

androidInput.press() ​

添加于: v1.9 异步

按下 key 键。

参数

  • key AndroidKey

    要按下的键。

androidInput.swipe() ​

添加于: v1.9 异步

沿着 segments 定义的路径进行滑动。

参数

  • from Object

    滑动的起始点。

    • x float
    • y float
  • segments Array<Object>

    滑动手势中跟随 from 点之后的各个点。

    • x float
    • y float
  • steps int

    每个段的步数。每一步需要 5 毫秒完成,所以 100 步意味着每段需要半秒钟。

androidInput.tap() ​

添加于: v1.9 异步

在指定的 point 位置点击。

参数

  • point Object

    点击的位置。

    • x float
    • y float

androidInput.type() ​

添加于: v1.9 异步

在当前聚焦的组件中输入 text。

参数

  • text string

    要输入的文本。

基于 Apache 2.0 许可证发布。