use sendInput not keybd_event

[docs: Note This function has been superseded]
This commit is contained in:
vcaesar 2018-10-17 16:12:48 -04:00
parent 2451b767ae
commit 3291faad53

View File

@ -103,7 +103,17 @@ void win32KeyEvent(int key, MMKeyFlags flags){
// scan |= 0x80;
// }
keybd_event(key, scan, flags, 0);
// keybd_event(key, scan, flags, 0);
INPUT keyInput;
keyInput.type = INPUT_KEYBOARD;
keyInput.ki.wVk = key;
keyInput.ki.wScan = scan;
keyInput.ki.dwFlags = flags;
keyInput.ki.time = 0;
keyInput.ki.dwExtraInfo = 0;
SendInput(1, &keyInput, sizeof(keyInput));
}
#endif