# DInput, after working, stops working.

## Recommended Posts

Hi. With directInput, I'm having some trouble. When I start the program all is dandy. I have a messagebox hooked to a mouse key press. When I press that the message box comes up. But then
hr = m_keyboard->GetDeviceState(sizeof(UCHAR[256]), (LPVOID)keystate);
if (FAILED(hr))
MessageBox(NULL, "getdevicestate keyboard", "ERROR", MB_OK);


this errors. It only happens directly after I press something on the mouse. I then added a messagebox to a keyboard button press. So after I press that the same thing happens. It also spews out random messages. Like.. when the messageboxes come up some are that of a keyboard button being pressed, even though that is not the case. So I then tried rearranging the order of the GetDeviceState was. The mouse first this time. But the keyboard is still the only error shown. Debugging doesn't help. Thanks.

## Create an account

Register a new account

• ### Forum Statistics

• Total Topics
628277
• Total Posts
2981771

• 10
• 11
• 17
• 10
• 9