GetPoint drag behavior + exit when clicking outside viewport

Hi,

I’m working on a custom keypoint move tool in Python using RhinoCommon. It runs inside a GetPoint with DynamicDraw, so geometry updates continuously while the mouse moves.

What I’m trying to do is make it behave more like a drag tool: click, drag, release, done.

Aslo if the user clicks outside the viewport, GetPoint just keeps waiting. I’d like the command to immediately exit when the user clicks outside the viewport, instead of staying in the modal loop. Esc works, but clicking outside doesn’t end it.

Is there a Rhino-native way to detect that while inside GetPoint? Or is using a MouseCallback the intended approach for this kind of behavior?

The other way I have been trying is to recreate that environment my self but that keeps bringing me to essentially grab inputs directly from windows and attempt to extrapolate that onto the rhino grid which is slow and very bug prone.

Thanks.

Hi @Ethan_Roy_Lanouette,

Without thinking about this too much, you might be able to hook the mouse, on Windows, and check to see there the mouse down occurred.

Something to explore.

– Dale