DirectInput Keyboard Errors

This topic is 3309 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

I'm making an expandable engine that keeps giving me errors when I input a key code into it.
void GetKeys(UCHAR* KeyState)
{
dinkeyboard->Acquire();

dinkeyboard->GetDeviceState(sizeof(UCHAR[256]), (LPVOID)keystate);

for(int Index = 0; Index < 256; Index++)
*(KeyState + Index) &= 0x80;

return;
}

if (GetKeys(DIK_ESCAPE) & 0x80)
{
PostMessage(hWnd, WM_DESTROY, 0, 0);
}


those are obviously in separate .cpp files. However it keeps giving me an error that states: error C2664: 'GetKeys' : cannot convert parameter 1 from 'int' to 'UCHAR *'

Share on other sites
Your function seems a very complicated version of GetAsyncKeyState. AFAIK, DirectInput is deprecated in favour of standard Win32 input handling. More about this from Evil Steve.