Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
wmgshurik
380 Views, 2 Replies

Pick method and Esp and Enter keys

Hello!

 

I use CommandManager.Pick() and want to handle escape and enter keys at the same time, but I dont know how to do it. 

 

Inventor blocks WindowsForms's KeyEvents.  If I create new InteractionEvents, it works but not with Pick method. This function has some own interaction events, whiсh dont want to join to MY interaction events....

 

Have you got any ideas?

wmgshurik
in reply to: wmgshurik

 invApp.CommandManager.UserInputEvents.OnTerminateCommand += UserInputEvents_OnTerminateCommand;

private void UserInputEvents_OnTerminateCommand(string CommandName, NameValueMap Context)
        {
            MessageBox.Show("Terminated");
        }

This is for escape key.

But how can I catch Enter key?

wmgshurik
in reply to: wmgshurik

Well, OnTerminateCommand also triggered when command finishes normally, but it is not a problem in my case.

 

But Enter key doesnt work.