Hi guys, I was trying to use ESC key to break a loop, and found out 2 ways to use ESC key.
One is scriptcontext.escape_test(False), Another is use OnEscapeKeyPressed as a event handler. But after test, both of them require couple of times of pressing ESC to break loop.
How can I make ESC more accurately and stably like those original rhino commands? The attachments are test code I found.
esc test with OnEscapeKeyPressed.py (991 Bytes)
esc test with scriptcontext.escape_test.py (258 Bytes)
Alternatively can I use third party libraries like pynput to monitor mouse and keyboard?
I think third party libraries will make some trouble if I distribute my script to others who don`t have them, am I correct? Is there any other way to solve this problem conveniently(like auto install libraries when installing my script)?
Many thanks
3 posts - 3 participants