View Single Post
Old 09-29-2019, 09:21 AM   #721
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,110
Default

You could compare against previous state and only execute if state has changed compared to previous state, something like this:

Code:
prevState = -1

function main()
  A=reaper.JS_Mouse_GetState(-1)
  reaper.defer(main)
  if prevState ~= A then
   if A == 5 then
      reaper.ShowConsoleMsg("CMD+Click")
    end
  end
  prevState = A
end

main()
Makes use of a global variable though, not sure if there'd be a way around it..
nofish is offline   Reply With Quote