注册鼠标点击快捷键 - RegisterMouseButton
函数简介
注册鼠标点击快捷键,可监听鼠标点击及点击次数
注册鼠标快捷键监听前需要调用StartHotkeyHook安装键盘鼠标钩子
回调函数 void MouseCallback(int button,int x, int y, int clicks)
- button 参考参数定义
- x X坐标
- y Y坐标
- clicks 点击次数
参考windows函数 SetWindowsHookExW 实现
接口名称
RegisterMouseButton
DLL调用
int RegisterMouseButton(long ola, int button, int type ,MouseCallback callback)
参数定义:
ola
(长整型数): OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成。button
(整型数): 按键类型,取值如下:- 鼠标左键(值1)
- 鼠标右键(值2)
- 鼠标中间(值3)
- 拓展键1(值4)
- 拓展键2(值5)
type
(整型数): 按键状态,使用Modifier枚举值的位或组合,取值如下:- 鼠标点击(值0)
- 鼠标按下(值1)
- 鼠标释放(值2)
callback
回调函数 void MouseCallback(int button,int x, int y, int clicks)- button 参考参数定义
- x X坐标
- y Y坐标
- clicks 点击次数
返回值
注册监听状态
整型数:
1 : 成功
0 : 失败