Sending key presses to other applications without Windows Forms

Because I'm working with the Godot game engine for the graphics interface, I'm kinda restricted with their Mono implementation. That prevents me from using the windows forms stuff. So I've tried the solutions using user32.dll but they only work when I move my mouse. I assume that is happening because of the following: I have a touchscreen with a button. When that button is pressed, there should be the according key action. I think that because of the touch input, it's doing some funky stuff with the window focus and that results in the behaviour described above. Code looks as follows:
Was this page helpful?