This topic is now archived and is closed to further replies.


Buffered input help needed?

Recommended Posts

Vlade0000    122
Hi guys i want to get input from the user (like the users name or what eva) so now i use buffered input to read my stuff into a string like this //KB_BUFFER = 20 USHORT temp; DIDEVICEOBJECTDATA didod[KB_BUFFER]; DWORD dwElements = KB_BUFFER; if(FAILED(hr = lpdi_kb->GetDeviceData(sizeof(DIDEVICEOBJECTDATA), didod, &dwElements, DIGDD_PEEK))) { if(hr == DIERR_INPUTLOST) { if(FAILED(hr = lpdi_kb->Acquire())) { MessageBox(NULL, "Keyboard has been lost", "ERROR", MB_OK | MB_ICONEXCLAMATION); logerror(DXI_ER010); killDXInput(); } } } for(DWORD i = 0; i < dwElements; i++) { scan2ascii(didod.dwOfs, &temp); inputStr[i] = (char)temp; } //inputStr size is = to KB_BUFFER now my problem is when i call this @ 60hz all my input is double. it looks kinds like this when i print it "tthhiiss iiss aa tteesstt" any ideas, sucgestions or links? cheers

Share this post

Link to post
Share on other sites