Detecting mouse status in c# - BUG with viewports

Hi all!

I was searching for a system method to retrieve mouse “click” status…
This:

private void RunScript(object x, object y, ref object A)
  {
    A = System.Windows.Forms.Control.MouseButtons;
  }

… works, but makes the Viewports “duplicate” the rectangle selection:
detect_mouse_status
detect_mouse_status.gh (2.4 KB)

There is any possible workaround to avoid this behavior?
If it’s a possibility, it would good to even disable completely windows selection rectangles in rhino, as while my script is running they are not needed…

Have you tried mousrat?

Don’t have it at the moment, but if the issue doesn’t occur with mouserat maybe you can ask him how he did it.

That is really interesting, and it works great!
Thanks for pointing it out. (I’m really at the antipodes with the plug-in realm…)