-1

I would like to make a Logitech Lua script where it continuously holds down the mouse buttons for example mouse button 5 without holding it, just have the mouse button turned on until i release it by clicking it once. if anyone could help, it'd be much appreciated.

Egor Skriptunoff
  • 23,359
  • 2
  • 34
  • 64
Vatzepack
  • 15
  • 2
  • 7

2 Answers2

0

Open https://douile.github.io/logitech-toggle-keys/APIDocs.pdf

Read through the table of contents or search "press"

Find page 18: PressMouseButton

PressMouseButton The PressMouseButton() function is used to simulate a mouse button press. NOTE: Calling IsMouseButtonPressed immediately afterwards, will likely return the previous state. It will take a few milliseconds for the operation to complete. PressMouseButton( button )

Piglet
  • 27,501
  • 3
  • 20
  • 43
0

Step #1
Set script.

function OnEvent(event, arg)
   if event == "MOUSE_BUTTON_PRESSED" and arg >= 2 and arg <= 5 then
      local btn = ({1, 3, 2, 4, 5})[arg]
      if IsMouseButtonPressed(btn) then
         ReleaseMouseButton(btn)
      else
         PressMouseButton(btn)
      end
   elseif event == "PROFILE_DEACTIVATED" then
      for btn = 2, 5 do
         if IsMouseButtonPressed(btn) then
            ReleaseMouseButton(btn)
         end
      end
   end
end

Step #2
Unbind default actions from buttons 2-5 in LGS/GHUB.

Egor Skriptunoff
  • 23,359
  • 2
  • 34
  • 64