W key in Navisworks

W key in Navisworks

piero.urrutiaRA2LP
Contributor Contributor
730 Views
4 Replies
Message 1 of 5

W key in Navisworks

piero.urrutiaRA2LP
Contributor
Contributor

Is there a way to override the W key to have the API do something else rather than show/hide the steering wheel? 

I am using the KeyDown() function for InputPlugin but every time I use the W key, it does not perform the intended tasks, instead it shows/hides the steering wheel for navigation.

 

Any ideas?

 

Thanks!

0 Likes
731 Views
4 Replies
Replies (4)
Message 2 of 5

lanneauolivier
Advocate
Advocate

Hi,

try returning true at the end of KeyDown(), this stops Navisworks default behavior.

Message 3 of 5

piero.urrutiaRA2LP
Contributor
Contributor

Thanks! It worked! However, when I press W, the function does not go through instead it shows/hides the steering wheel. In order to make it work, I have to first press other keys that have custom functions tied to them and then press W. Do you know what could be the issue here?

 

0 Likes
Message 4 of 5

lanneauolivier
Advocate
Advocate

Hi,

InputPlugin have the focus when le viewer has the focus to.

Clic on the viewer, then your W key should work properly.

This is quite annoying for key detection, you can still force the focus on the viewer with

Autodesk.Navisworks.Gui.Common.DockingView.ActiveView.Activate();

 

Message 5 of 5

piero.urrutiaRA2LP
Contributor
Contributor

Thanks for the response! I do click on the viewer before pressing any keys. The only key that does not respond is the W key, the only way to make it work is to press other keys before pressing W. I think it might be because W triggers the SteeringWheel, but I cannot figure out how to solve it. It somewhat works as long as I press other keys before pressing W, but I don't know if there is something I can implement in order to avoid this from happening.

 

Thanks!

0 Likes