From a4ac0f23014e5a6227d6c43fa33bfdc3088ff455 Mon Sep 17 00:00:00 2001 From: Kaaasper Date: Thu, 17 Nov 2022 00:51:14 +0100 Subject: [PATCH] quick fix for prepatch keyDown bug --- src/engine/mega-macro-engine.lua | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/engine/mega-macro-engine.lua b/src/engine/mega-macro-engine.lua index 6b4f741..b254d93 100644 --- a/src/engine/mega-macro-engine.lua +++ b/src/engine/mega-macro-engine.lua @@ -119,14 +119,15 @@ end local function GetMacroStubCode(macroId) -- Fix a bug that causes click events not to register only when CVar ActionButtonUseKeyDown is set to 1. + local keyDownOrUp = GetCVar("ActionButtonUseKeyDown") local primaryMacroButtonClickValue = GetCVar("ActionButtonUseKeyDown") == "1" and " LeftButton" or " " return GenerateIdPrefix(macroId).."\n".. - "/click [btn:1] "..ClickyFrameName..macroId..primaryMacroButtonClickValue.."\n".. - "/click [btn:2] "..ClickyFrameName..macroId.." RightButton\n".. - "/click [btn:3] "..ClickyFrameName..macroId.." MiddleButton\n".. - "/click [btn:4] "..ClickyFrameName..macroId.." Button4\n".. - "/click [btn:5] "..ClickyFrameName..macroId.." Button5\n" + "/click [btn:1] "..ClickyFrameName..macroId..primaryMacroButtonClickValue.." "..keyDownOrUp.."\n".. + "/click [btn:2] "..ClickyFrameName..macroId.." RightButton "..keyDownOrUp.."\n".. + "/click [btn:3] "..ClickyFrameName..macroId.." MiddleButton "..keyDownOrUp.."\n".. + "/click [btn:4] "..ClickyFrameName..macroId.." Button4 "..keyDownOrUp.."\n".. + "/click [btn:5] "..ClickyFrameName..macroId.." Button5 "..keyDownOrUp.."\n" end local function SetupGlobalMacros()