按键 - KeyPress
函数简介
按下指定的虚拟键码。
接口名称
KeyPress
DLL调用
int KeyPress(long ola, int vk_code);
参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| ola | 长整数型 | OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成。 |
| vk_code | 整数型 | 虚拟键码(Virtual-Key Code)。可填 十六进制(如 0x0D)或 十进制(如 13),二者等价。完整常量、十进制对照与 字符串别名(KeyPressCharMap) 见 虚拟键码表。 |
示例
C++
long instance = CreateCOLAPlugInterFace();
// 按下回车键:VK_RETURN = 0x0D = 13(十进制)
KeyPress(instance, 0x0D);
KeyPress(instance, 13);
// 按下 ESC:VK_ESCAPE = 0x1B = 27
KeyPress(instance, 0x1B);
KeyPress(instance, 27);
Python
# 待补充
返回值
1 成功,0 失败。
