diff --git a/dlls/dinput8/tests/device.c b/dlls/dinput8/tests/device.c index c66c43c..c526235 100644 --- a/dlls/dinput8/tests/device.c +++ b/dlls/dinput8/tests/device.c @@ -74,7 +74,7 @@ static void test_device_input(IDirectInputDevice8A *lpdid, DWORD event_type, DWO keybd_event( event, DIK_SPACE, 0, 0); if (event_type == INPUT_MOUSE) - mouse_event( event, 0, 0, 0, 0); + mouse_event( event, 50, 50, 0, 0); IDirectInputDevice8_Poll(lpdid); hr = IDirectInputDevice8_GetDeviceData(lpdid, sizeof(obj_data), &obj_data, &data_size, 0); @@ -96,8 +96,8 @@ static void test_device_input(IDirectInputDevice8A *lpdid, DWORD event_type, DWO } else if (event_type == INPUT_MOUSE) { - mouse_event(MOUSEEVENTF_LEFTDOWN, 1, 1, 0, 0); - mouse_event(MOUSEEVENTF_LEFTUP, 1, 1, 0, 0); + mouse_event(MOUSEEVENTF_LEFTDOWN, 50, 50, 0, 0); + mouse_event(MOUSEEVENTF_LEFTUP, 50, 50, 0, 0); } IDirectInputDevice8_Poll(lpdid); @@ -108,6 +108,9 @@ static void test_device_input(IDirectInputDevice8A *lpdid, DWORD event_type, DWO data_size = 1; hr = IDirectInputDevice8_GetDeviceData(lpdid, sizeof(obj_data), &obj_data, &data_size, 0); ok(hr == DI_OK && data_size == 1, "GetDeviceData() failed: %08x cnt:%d\n", hr, data_size); + + hr = IDirectInputDevice8_Unacquire(lpdid); + ok( SUCCEEDED(hr), "Failed to unacquire device hr=%08x\n", hr); } static void test_build_action_map(IDirectInputDevice8A *lpdid, DIACTIONFORMATA *lpdiaf, @@ -320,11 +323,17 @@ static void test_action_mapping(void) if (data.mouse != NULL) { + HWND hwnd = CreateWindowA("static", "dinput", WS_POPUP | WS_VISIBLE, 0, 0, 100, 100, NULL, NULL, NULL, NULL); + ok(hwnd != NULL, "failed to create window\n"); + SetCursorPos(50, 50); + /* Test mouse BuildActionMap */ test_build_action_map(data.mouse, data.lpdiaf, DITEST_MOUSEBUTTON0, DIDFT_PSHBUTTON, 0x03); test_build_action_map(data.mouse, data.lpdiaf, DITEST_YAXIS, DIDFT_RELAXIS, 0x01); test_device_input(data.mouse, INPUT_MOUSE, MOUSEEVENTF_LEFTDOWN, 3); + + DestroyWindow(hwnd); } }