Standard Keyboard shortcuts not working with rhino.inside WPF

Hi @dale,

I have a WPF application where I have an option to start rhino using rhino.inside. Once Rhino starts, everything works well except standard keyboard keyboard shortcuts that should activate when I press for example delete key (_Delete) or enter key (the last used command). When I press delete I only hear a standard windows 11 warning sound in my computer and nothing happens. Any suggestions?

Thanks In advance.

@kike - is this something you can help with?

Hi @kike
Any thoughts?

Hi @dale and @kike . Any progress on this topic?

Hi @mattipi,

I don’t believe anyone has had time to look into this.

My guess is that you’re is using the host application message loop to dispatch, and Rhino needs its own message loop be called in order to enable some hacks we have for keyboard shortcuts and other things like the Idle event.

There isn’t any easy answer to this. If possible, can you make a simple WPF test app that reproduces this?

Thanks,

– Dale

Hi @dale ,

I finally got back to the topic. I tried opening rhino with the SampleWindFormsApp from:

The only thing I did was that I changed the opening style to “Normal” so that I can see the rhino application. With only this change I have the same issue as with my application. When I press delete the only thing that happens is that i hear a windows warning sound.

Hi @dale and @kike . Any progress on this topic?

@dale @kike do you have an update on this?

Hi @mattipi, @m_dev,

I don’t believe anyone has look at this.

My guess is that he is using the Host application message loop to dispatch and Rhino needs its own message loop be called in order to enable some hacks we have for keyboard shortcuts and other things like the Idle event. There may be no easy way to fix this.

– Dale

Hi @m_dev,

I did some changes on our sample repo.
Could you please test same sample on this branch mcneel/rhino-developer-samples at kike/8/main?

It works as expected on my side but just want to be sure works on yours before merging into the main one.

3 Likes

Hi @kike

This is much clearer now, thank you!
It is working now fine in my own case by implementing that logic and it seems stable so far.

@dale thank you too for having a look

Generally It’s difficult to find any documentation about these run and idiling functions in RhinoCore, any hint on where it is or maybe if there are plans to improve on that anytime soon?

Thanks Kike! Finally came back to the forum after using my software for another 4 months with this problem! Had to do some chatgpt iterations to get this working with my WPF MVVM app. Here is the modified code that worked with WPF app…