Archived

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

(DInput) Clearing the keyboard input buffer

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi all, I''ve got a fairly simple keyboard handler in DInput9 (uses v8 interfaces tho), it uses buffered input and then despatches data to one of many possible game states (the game state sees it as an onKeypress/onKeyUp type thing) However, when the game state changes (say from menu-to-menu) residual keyboard events occur, such that u need lightning fast keyboard reflexes NOT to accidentally trigger a menu option in the next screen can I discard any existing buffered events whenever I want? such that when I load the next screen it starts "fresh"? cheers, Jack DirectX 4 VB: All you need for multimedia programming in Visual Basic Formula 1 Championship Manager, My Game Project.

Share this post


Link to post
Share on other sites
If you are using buffered input (and calling GetDeviceData), you can implement a flush function by simply calling GetDeviceData until no more elements remain in the buffer.

If you are using unbuffered input (and calling GetDeviceState), you will have to do something like waiting until all menu keys are up before accepting a menu key down state.

Share this post


Link to post
Share on other sites