Logitech Script, Press and hold key until releas

damian picture damian · Jul 31, 2019 · Viewed 7.5k times · Source

Is it possible to make Logitech scripts targets letters?

For example > F

Using mouse button 5 if I wanted this logitech script to press hold F key until release of mouse button 5 how would I do that?

function OnEvent(event, arg)

if event == "MOUSE_BUTTON_RELEASED" and arg == 5 then

PressAndReleaseMouseButton(5);

end

Answer

Egor   Skriptunoff picture Egor Skriptunoff · Jul 31, 2019
function OnEvent(event, arg)
   if event == "MOUSE_BUTTON_PRESSED" and arg == 5 then
      PressKey("F")
   end
   if event == "MOUSE_BUTTON_RELEASED" and arg == 5 then
      ReleaseKey("F")
   end
end

But you can do the same without writing the script.
Just bind the key F to mouse button 5 by simple drag-and-drop.