我需要模拟向上箭头键,所以我使用sendinput,我在https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx上看到向上箭头键是0x26,但问题是程序模拟按下“L”而没有向上箭头键,为什么? 这是代码:
INPUT ip;
ip.type = INPUT_KEYBOARD;
ip.ki.time = 0;
ip.ki.wVk = 0;
ip.ki.dwExtraInfo = 0;
ip.ki.dwFlags = KEYEVENTF_SCANCODE;
ip.ki.wScan =0x26; //UP ARROW key
SendInput(1, &ip, sizeof(INPUT));
ip.ki.dwFlags = KEYEVENTF_SCANCODE | KEYEVENTF_KEYUP;
SendInput(1, &ip, sizeof(INPUT));