C++如何监控键盘输入输出
void rightstop(int time)
{
SHORT key;
UINT mappedkey;
INPUT input = {0};
key = VkKeyScan('a');
mappedkey = MapVirtualKey(LOBYTE(key), 0);
input.type = INPUT_KEYBOARD;
input.ki.dwFlags = KEYEVENTF_SCANCODE;
input.ki.wScan = mappedkey;
SendInput(1, &input, sizeof(input));
delay(time);
input.ki.dwFlags = KEYEVENTF_SCANCODE | KEYEVENTF_KEYUP;
SendInput(1, &input, sizeof(input));
}