7 Star 13 Fork 3

狂野之弦 / Logitech+AHK Macro Script

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
脚本宏控制录制宏.lua 1.23 KB
一键复制 编辑 原始数据 按行查看 历史
狂野之弦 提交于 2018-03-06 09:40 . Update 脚本宏控制录制宏.lua
EnablePrimaryMouseButtonEvents(true);
EventSource = "MOUSE_BUTTON_PRESSED"; --罗技键盘G_PRESSED
CurrentMacro = ""; --运行中的宏
Macro1 = "TianQian650";
Macro2 = "PaoMa";
--鼠标按键代码
LeftButton = 1;
RightButton = 2;
MiddleButton = 3;
X1Button = 4;
X2Button = 5;
function OnEvent(event, arg, family)
Macro_Start_Stop(Macro1, X2Button, event, arg); --侧键前进启动宏,再按结束宏
Macro_Switch(Macro2, LeftButton, event, arg); --左键上马
Macro_Switch(Macro1, RightButton, event, arg); --右键天谴
end
--启动和结束宏
function Macro_Start_Stop(MacroName, MouseButton, event, arg)
if (event == EventSource and arg == MouseButton) then
if (CurrentMacro ~= "") then
RestartMacro("");
Macro_Release(); --松开全部未释放的按键
else
RestartMacro(MacroName);
end
end
end
--切换宏
function Macro_Switch(MacroName, MouseButton, event, arg)
if (event == EventSource and arg == MouseButton) then
if (CurrentMacro ~= "") then
RestartMacro(MacroName);
end
end
end
function RestartMacro(MacroName)
AbortMacro();
PlayMacro(MacroName);
CurrentMacro = MacroName;
end
function Macro_Release()
ReleaseKey("W");
end
AutoHotkey
1
https://gitee.com/wildstring/Logitech-AHK-Macro-Script.git
git@gitee.com:wildstring/Logitech-AHK-Macro-Script.git
wildstring
Logitech-AHK-Macro-Script
Logitech+AHK Macro Script
master

搜索帮助