diff --git a/rostests/winetests/dinput/joystick.c b/rostests/winetests/dinput/joystick.c index eb60f6484f8..8c4392ab964 100644 --- a/rostests/winetests/dinput/joystick.c +++ b/rostests/winetests/dinput/joystick.c @@ -540,7 +540,6 @@ static BOOL CALLBACK EnumJoysticks(const DIDEVICEINSTANCEA *lpddi, void *pvRef) dip_gain_set.diph.dwHeaderSize = sizeof(DIPROPHEADER); dip_gain_set.diph.dwObj = 0; dip_gain_set.diph.dwHow = DIPH_DEVICE; - dip_gain_set.dwData = 10000; dip_gain_get.diph.dwSize = sizeof(DIPROPDWORD); dip_gain_get.diph.dwHeaderSize = sizeof(DIPROPHEADER); dip_gain_get.diph.dwObj = 0; diff --git a/rostests/winetests/dinput/keyboard.c b/rostests/winetests/dinput/keyboard.c index 5a9ac5100b0..8d62ffc4698 100644 --- a/rostests/winetests/dinput/keyboard.c +++ b/rostests/winetests/dinput/keyboard.c @@ -95,6 +95,27 @@ static void acquire_tests(IDirectInputA *pDI, HWND hwnd) for (i = 0; i < sizeof(custom_state) / sizeof(custom_state[0]); i++) ok(custom_state[i] == 0, "Should be zeroed, got 0x%08x\n", custom_state[i]); + /* simulate some keyboard input */ + SetFocus(hwnd); + keybd_event('Q', 0, 0, 0); + hr = IDirectInputDevice_GetDeviceState(pKeyboard, sizeof(custom_state), custom_state); + ok(SUCCEEDED(hr), "IDirectInputDevice_GetDeviceState() failed: %08x\n", hr); + if (!custom_state[0]) + win_skip("Keyboard event not processed, skipping test\n"); + else + { + /* unacquiring should reset the device state */ + hr = IDirectInputDevice_Unacquire(pKeyboard); + ok(SUCCEEDED(hr), "IDirectInputDevice_Unacquire() failed: %08x\n", hr); + hr = IDirectInputDevice_Acquire(pKeyboard); + ok(SUCCEEDED(hr), "IDirectInputDevice_Acquire() failed: %08x\n", hr); + hr = IDirectInputDevice_GetDeviceState(pKeyboard, sizeof(custom_state), custom_state); + ok(SUCCEEDED(hr), "IDirectInputDevice_GetDeviceState failed: %08x\n", hr); + for (i = 0; i < sizeof(custom_state) / sizeof(custom_state[0]); i++) + ok(custom_state[i] == 0, "Should be zeroed, got 0x%08x\n", custom_state[i]); + } + keybd_event('Q', 0, KEYEVENTF_KEYUP, 0); + if (pKeyboard) IUnknown_Release(pKeyboard); }