dinput/tests: Try harder to avoid spurious keyboard input.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2018-12-10 14:58:57 +01:00
parent 2bd84420a0
commit d62ac319d2
1 changed files with 3 additions and 0 deletions

View File

@ -411,6 +411,8 @@ static void test_dik_codes(IDirectInputA *dI, HWND hwnd, LANGID langid)
if (!PeekMessageA(&msg, hwnd, 0, 0, PM_REMOVE))
{
U(in).ki.dwFlags = KEYEVENTF_KEYUP;
SendInput(1, &in, sizeof(in));
win_skip("failed to queue keyboard event\n");
break;
}
@ -471,6 +473,7 @@ static void keyboard_tests(DWORD version)
hwnd = CreateWindowA("static", "Title", WS_OVERLAPPEDWINDOW | WS_VISIBLE, 10, 10, 200, 200,
NULL, NULL, NULL, NULL);
ok(hwnd != NULL, "err: %d\n", GetLastError());
SetForegroundWindow( hwnd );
if (hwnd)
{