Actually a subject, the code is like this:
> [DllImport("user32.dll")] > static extern void keybd_event(byte bVk, byte bScan, uint dwFlags, UIntPtr dwExtraInfo); > keybd_event((byte)0x51, (byte)0x02, 0,UIntPtr.Zero); > Thread.Sleep(100); > keybd_event((byte)0x51q, (byte)0x82, (uint)0x2, UIntPtr.Zero); > Thread.Sleep(100); In some windows, the button is pressed, in some - not, if I understand correctly, then the program needs to explain to which window to send. We have a game on Direct3D.