罗技鼠标宏 Lua 脚本编写教程:按键绑定 Z、V、B+3、P、V、T1-T6
以下是一个使用 Lua 脚本编写的罗技鼠标宏示例,其中按键分别为 Z、V、B+3、P、V、T1、T2、T3、T4、T5、T6:
EnablePrimaryMouseButtonEvents(true)
function OnEvent(event, arg)
if event == 'MOUSE_BUTTON_PRESSED' and arg == 1 then
PressKey('Z')
elseif event == 'MOUSE_BUTTON_RELEASED' and arg == 1 then
ReleaseKey('Z')
elseif event == 'MOUSE_BUTTON_PRESSED' and arg == 2 then
PressKey('V')
elseif event == 'MOUSE_BUTTON_RELEASED' and arg == 2 then
ReleaseKey('V')
elseif event == 'MOUSE_BUTTON_PRESSED' and arg == 3 then
PressKey('B')
Sleep(30)
PressKey('3')
Sleep(30)
ReleaseKey('3')
Sleep(30)
ReleaseKey('B')
elseif event == 'MOUSE_BUTTON_PRESSED' and arg == 4 then
PressKey('P')
elseif event == 'MOUSE_BUTTON_RELEASED' and arg == 4 then
ReleaseKey('P')
elseif event == 'MOUSE_BUTTON_PRESSED' and arg == 5 then
PressKey('V')
elseif event == 'MOUSE_BUTTON_RELEASED' and arg == 5 then
ReleaseKey('V')
elseif event == 'MOUSE_BUTTON_PRESSED' and arg == 6 then
PressKey('T1')
elseif event == 'MOUSE_BUTTON_RELEASED' and arg == 6 then
ReleaseKey('T1')
elseif event == 'MOUSE_BUTTON_PRESSED' and arg == 7 then
PressKey('T2')
elseif event == 'MOUSE_BUTTON_RELEASED' and arg == 7 then
ReleaseKey('T2')
elseif event == 'MOUSE_BUTTON_PRESSED' and arg == 8 then
PressKey('T3')
elseif event == 'MOUSE_BUTTON_RELEASED' and arg == 8 then
ReleaseKey('T3')
elseif event == 'MOUSE_BUTTON_PRESSED' and arg == 9 then
PressKey('T4')
elseif event == 'MOUSE_BUTTON_RELEASED' and arg == 9 then
ReleaseKey('T4')
elseif event == 'MOUSE_BUTTON_PRESSED' and arg == 10 then
PressKey('T5')
elseif event == 'MOUSE_BUTTON_RELEASED' and arg == 10 then
ReleaseKey('T5')
elseif event == 'MOUSE_BUTTON_PRESSED' and arg == 11 then
PressKey('T6')
elseif event == 'MOUSE_BUTTON_RELEASED' and arg == 11 then
ReleaseKey('T6')
end
end
请注意,此脚本假设您的罗技鼠标已正确配置并且已启用主要鼠标按钮事件。您可以根据需要修改和自定义这个宏。
原文地址: https://www.cveoy.top/t/topic/pANd 著作权归作者所有。请勿转载和采集!