0

As the title says im looking to find out how to make it so that when i click one of the buttons on my mouse (mouse 4-6) that it will press a key but if i double click that same button it presses a different key.

1 Answers1

0

I found and modify. For copy and paste on one button. In LGS, mouse buton 4 have CTRL assigned. But there is some error, can't resolve it. One time too many '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

`

maxin
  • 1
  • If you have a new question, please ask it by clicking the [Ask Question](https://stackoverflow.com/questions/ask) button. Include a link to this question if it helps provide context. - [From Review](/review/late-answers/29920941) – DavidW Sep 26 '21 at 08:33