如何使用 G 系列 Lua API v8.45 更改双击同一按钮时的按键按下方式

正如标题所说,我想了解如何使当我点击鼠标上的一个按钮(鼠标 4-6)时,它会按下一个键,但是如果我双击同一个按钮,则按下不同的键。

点赞
用户16236839
用户16236839

TIMEOUT = 15000`

当我找到并修改后,在LGS中将鼠标按钮4分配为CTRL键。但是存在一些错误,无法解决。太多的“ctrl + c”一次性复制和粘贴。

TIMEOUT = 15000

function OnEvent(event, arg, family)
        if event == "MOUSE_BUTTON_PRESSED" and arg == 4
            then
                if GetRunningTime() - (timestamp or 0) >= TIMEOUT
                then index = 0
                end

            index = (index or 0) + 1

            if index > 2
            then index = 1
            end

            if index == 1
            then PressKey("c")
            elseif index == 2
            then PressKey("v")
            end

            timestamp = GetRunningTime()

        elseif event == "MOUSE_BUTTON_RELEASED" and arg == 4
        then
            if index == 1
            then ReleaseKey("c")
            elseif index == 2
            then ReleaseKey("v")
end
end
end
2021-09-25 23:02:22