public static void TypeKey(bool up, ScanCode code) { tagKEYBDINPUT input = new tagKEYBDINPUT() { wScan = code }; if (up) { input.dwFlags = KeyEventFlags.KEYEVENTF_KEYUP; } InjectKeyboardInput(ref input, 1); }
private static extern bool InjectKeyboardInput(ref tagKEYBDINPUT input, uint count);