May I stop executing a command when users press mouse right ? (C++)

I want to work the function by triggering the button.
Therefore, Is it possible to stop executing it ?

Of course this is possible. But I would recommend to use the Esc key for aborting a long-running process, instead of the RMB, because this is more like other Rhino commands work. Indeed, the RMB is typically used as replacement for the Enter button to re-run the last command.

To do this you must run the long-running process on a separate thread and abort the thread when the user has pressed Escape.

Thanks! :grin:
It seem a little difficult for me. I need to think this process.

Thanks ! :smile: