Forum Discussion

Martin82's avatar
Martin82
Copper Contributor
Nov 29, 2023

MSIX runtime behaviour and keyboard messages

Hello,

we are deploying a .NET 6 WPF Desktop Application via MSIX. So far everything worked great, but we hit a problem with the virtualization/sandbox of keyboard events.

 

We have a custom WPF control, that displays a grid when the user types (like a search combobox). While the user is typing, the search results are updated accordingly. The problem arises, when this update takes longer than about 50-100ms. All characters that are typed during this update are lost. The window-messages (KeyDown, KeyUp, ...) never fire on the control (or even the whole window).

 

When the exact same binary is launched via windows explorer (exe is started), the problem goes away. Keyboard Events (Window Messages) are queued until the ui thread is available and processed correctly.

 

From reading up on stackoverflow and github, I assume there is some kind of keyboard virtualization / sandboxing when the App is started and this part ignores all keyboard events when the UI thread is busy for too long.

 

We tried modifying the runtime behaviour with "Executable, RuntimeBehavior="win32App" TrustLevel="mediumIL"", but it doesn't have any effect on this problem.

 

My question: Is there any other way I can modify my MSIX so that the application starts as a normal windows executable without any keyboard virtualization / sandbox?

 

Thanks and kind regards,

Martin

  • Martin,

    This definitely sounds like a design issue that is unrelated to running in the container. But you can prove that out by building to the "unpackaged" format.

    You are likely to get better help on a forum like StackOverflow than here.

Resources