Commit b735a42f authored by Akihiro Sagawa's avatar Akihiro Sagawa Committed by Alexandre Julliard

dinput/tests: Peek messages for the target window only.

This fixes "keyboard.c:365: Tests skipped: failed to queue keyboard event" message on my Win10 PC (real hardware). Since some thread messages and window messages, including IME related, are observed on the thread, they sometimes confuse the message handler. Signed-off-by: 's avatarAkihiro Sagawa <sagawa.aki@gmail.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 8001dda1
......@@ -374,18 +374,12 @@ static void test_dik_codes(IDirectInputA *dI, HWND hwnd, LANGID langid)
n = SendInput(1, &in, sizeof(in));
ok(n == 1, "got %u\n", n);
if (!PeekMessageA(&msg, 0, 0, 0, PM_REMOVE))
{
win_skip("failed to queue keyboard event\n");
break;
}
ok(msg.message == WM_KEYDOWN || broken(msg.message != WM_KEYDOWN), "expected WM_KEYDOWN, got %04x\n", msg.message);
/* this never happens on real hardware but tesbot VMs seem to have timing issues */
if (msg.message != WM_KEYDOWN)
if (!PeekMessageA(&msg, hwnd, 0, 0, PM_REMOVE))
{
win_skip("failed to queue keyboard event\n");
break;
}
ok(msg.message == WM_KEYDOWN, "expected WM_KEYDOWN, got %04x\n", msg.message);
DispatchMessageA(&msg);
trace("keydown wParam: %#lx (%c) lParam: %#lx, MapVirtualKey(MAPVK_VK_TO_CHAR) = %c\n",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment