How to programmatically fire keypress events in WinRT / C # / XAML?

The mission today was to enable remote control of the WinRT application. With all the wiring in place, there was time to implement remote control actions. The simplest implementation of these actions was to simply simulate a key press within a process.

Unfortunately, I couldn't find a way to do this. I'm sure this looks me in the face, but every solution I found on the internet was either through PInvoke, Windows Forms, or WPF dialects which are not available in WinRT.

Does anyone know a magic spell?

Thank.

+3


source to share


1 answer


It is not possible to programmatically trigger a user-initiated event in WinRT XAML. The reason is that some APIs can only be called through user interaction. Raising such events programmatically will bypass this security mechanism.



+2


source







All Articles