EnablePrimaryMouseButtonEvents
EnablePrimaryMouseButtonEvents()方法将启用鼠标按键 1的事件报告。 EnablePrimaryMouseButtonEvents(enable);
参数列表
0 或 false以禁用鼠标按键 1事件报告
enable
1 或 true 以启用鼠标按键 1事件报告
返回值
nil
备注信息
出于性能上的原因考虑,鼠标左键按键默认将不对触发事件进行报告。
代码示范
-- 启用鼠标按键 1事件报告
EnablePrimaryMouseButtonEvents(true);
--禁用鼠标按键 1事件报告
EnablePrimaryMouseButtonEvents(false);
36
G13可编程按键
G13 游戏面板具有一个可以模拟鼠标的摇杆,您可以为其分配一些鼠标功能。您可以通过在设置窗口中的配置文件选项面板或通过Lua脚本语言控制由摇杆所模拟鼠标的移动速度。以下实例可帮助您使用 Lua方法控制鼠标运行状态:
SetMouseSpeed ()
参数列表
New mousespeed
鼠标绝对移动速度由32 至 255。
返回值
nil
备注信息
无
代码示范
--设置鼠标移动速度至128 SetMouseSpeed(128);
GetMouseSpeed()
参数列表
Current mouse speed
当前鼠标的绝对移动速度。
返回值
当前模拟鼠标的移动速度
备注信息
无
代码示范
-- 获取鼠标移动速度
OutputLogMessage(\n”, GetMouseSpeed());
37
IncrementMouseSpeed()
参数列表
Mouse speed increment
返回值
nil
备注信息
加快鼠标速度最大值将被限制至 255。
代码示范
--增加鼠标移动速度是 10 IncrementMouseSpeed(10);
DecrementMouseSpeed()
参数列表
Mouse speed decrement
返回值
nil
备注信息
降低鼠标速度最小值将被限制至 32。
代码示范
-- 降低鼠标移动速度至 10 DecrementMouseSpeed(10);
38
G13 鼠标不具备任何原生按键,例如左键、中键以及右键等。鼠标按键必须通过Lua进行编程。您可以通过这个示例了解如何使用通用Lua代码实现鼠标按键触发操作:
if event==\
PressMouseButton( y ); end
if event==\
ReleaseMouseButton( y );
39
标准Lua5.1库
以下函数为受支持的标准库函数:
? string.byte ? string.char ? string.dump ? string.find ? string.format ? string.gmatch ? string.gsub ? string.len ? string.lower ? string.match ? string.rep ? string.reverse ? string.sub ? string.upper ? table.concat ? table.insert ? table.maxn ? table.remove ? table.sort ? math.abs ? math.acos ? math.asin ? math.atan ? math.atan2 ? math.ceil ? math.cos ? math.deg ? math.exp ? math.floor ? math.fmod ? math.frexp ? math.huge ? math.ldexp ? math.log ? math.log10 ? math.max ? math.min ? math.modf ? math.pi ? math.pow ? math.rad ? math.random
? math.randomseed ? math.sin ? math.sinh ? math.sqrt ? math.tan ? math.tanh
40