scanf command

Started by
9 comments, last by Muzlack 21 years, 9 months ago
OK, so I assume since you don''t understand this that you''re using IDirectInputDevice8::GetDeviceStateKeyboard or IDirectInputDevice8::GetDeviceState. That''s the wrong function to be using, you should use IDirectInputDevice8::GetDeviceData. Here''s a quick sample:


      DIDEVICEOBJECTDATA keyState[64];    unsigned long numKeys = 64;    m_Keyboard->GetDeviceData( sizeof(DIDEVICEOBJECTDATA), keyState, &numKeys, 0 );    for( int i = 0; i < (signed)numKeys; i++ )    {        if( keyState[i].dwData != 0 ) // key was pressed        {            char ascii = scan2asc( keyState[i].dwOfs );            // now append ascii to your string...        }    }  


codeka.com - Just click it.

This topic is closed to new replies.

Advertisement