按键str - KeyPressStr
函数简介
根据指定的字符串序列,依次按顺序按下其中的字符。
接口名称
KeyPressStr
DLL调用
int KeyPressStr(long ola, string key_str, int delay);
参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| ola | 长整数型 | OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成。 |
| key_str | 字符串 | 需要按下的字符串序列,如 "1234"、"abcd"、"7389,1462" 等。 |
| delay | 整数型 | 每按下一个按键的延时,单位毫秒(ms),值越大按的速度越慢。 |
示例
C++
long instance = CreateCOLAPlugInterFace();
// 依次输入字符串 "hello",每个按键间隔50ms
KeyPressStr(instance, "hello", 50);
// 输入数字序列,每个按键间隔100ms
KeyPressStr(instance, "123456", 100);
Python
# 待补充
返回值
1 成功,0 失败。
注意事项
- 此接口只支持
a-z 0-9 ~-=[];',./和空格,其它字符一律不支持(包括中文)。 - 在 SendString 和 SendStringEx 都无法输入文字时,可以考虑使用此接口。
