emulate pressing a keyboard key
emulate pressing a keyboard key SendInput() not equal to pressing key manually on keyboard in C++? I wanted to write a c++ code to emulate pressing a keyboard key "A": // Set up a generic keyboard event. ip.type = INPUT_KEYBOARD; ip.ki.wScan = 0; // hardware scan code for key ip.ki.time = 0; ip.ki.dwExtraInfo = 0; // Press the "..." key ip.ki.wVk = code; // virtual-key code for the "a" key ip.ki.dwFlags = 0; // 0 for key press SendInput( 1, &ip, sizeof(INPUT)); // Release the "..." key ip.ki.dwFlags = KEYEVENTF_KEYUP; // KEYEVENTF_KEYUP for key release SendInput( 1, &ip, sizeof(INPUT)); It