How can I simulate a button press in .NET?
I can do it with AutoHotKey with ease:
Any application will know that the button was pressed (just like it was pressed by me). I tried doing the same with:
[DllImport("user32.dll", SetLastError = true)]
public static extern uint SendInput(uint nInputs, INPUT pInputs, int cbSize);
static extern void keybd_event(byte bVk, byte bScan, uint dwFlags, int dwExtraInfo);
or using Windows Input Simulator (https://inputsimulator.codeplex.com/):
They all worked in Notepad or some other apps, but they never worked in my full screen game. Any idea how I can achieve it? I would like a solution which simulates a click globally on the system level.