函数:inputKey 输入按键码(仅支持 iOS)
函数名称:输入按键码
函数功能:模拟键盘输入按键码
函数方法
inputKey(str,time_min,time_max)
必填
参数 | 类型 | 说明 |
---|---|---|
str | string | 需要输入的字符串 |
选填
参数 | 类型 | 说明 |
---|---|---|
time_min | number | 最小时间间隔,单位:毫秒 |
time_max | number | 最大时间间隔,单位:毫秒 |
返回值
无
参数介绍
time_min、time_max 参数都不写默认输入字符之间延时时间为 10 毫秒;
只写 time_min 参数则延时时间默认为 time_min 的参数;
time_min、time_max 参数都存在则在 time_min ~ time_max 之间随机延时时间。
函数用例
require "TSLib"
--延时时间默认是 10 毫秒。
inputKey("123")
--延时时间默认是 15 毫秒。
--inputKey("123",15)
--延时时间为 15 ~ 20 毫秒之间。
--inputKey("123",15,20)