获取鼠标位置 - GetCursorPos
函数简介
获取鼠标位置。
接口名称
GetCursorPos
DLL调用
int GetCursorPos(long ola, int* x, int* y);
参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| ola | 长整数型 | OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成。 |
| x | 整数型指针 | 返回的鼠标X坐标。 |
| y | 整数型指针 | 返回的鼠标Y坐标。 |
示例
C++
long instance = CreateCOLAPlugInterFace();
int x = 0, y = 0;
// 获取当前鼠标坐标
int ret = GetCursorPos(instance, &x, &y);
if (ret == 1) {
printf("鼠标位置: x=%d, y=%d\n", x, y);
}
Python
# 待补充
返回值
1 成功,0 失败。
注意事项
- 此接口绑定后使用,获取的是相对游戏窗口的鼠标坐标。
