Disable escape key in Inventor

202 Views Asked by At

I have an addin with userinterface (usercontrol in a dockable window) that launches a command that takes a long time to run in Inventor and I don't want it to be possible to get interrupted by an user pressing the escape key (ascii 27). I've tried to set UserInteractionDisabled = true but it looks like the escape key slips throught the net. Also tried to subscribe to the keypress event, but no luck either.

Any one who can tell me how to block/disable the escape key?

2

There are 2 best solutions below

1
On

How do you start your command? Probably your addin should define an own Inventor-command that will run without the possibilty to be interrupted via escape. I would think, that the keypress event will work for your usercontrol only, so that won't do.

0
On

I've got an Inventor app with a command which takes about 25 min. to execute. It is not possible to cancel this command with the ESC key. I defined the command within a ribbon tab via Application.CommandManager.ControlDefinitions.AddButtonDefinition (that is what I meant by Inventor-command). May be your form itself proceeds the ESC key and stops running, but this is a guess only.