I have a little old system of managing user input that just detects WM_KEYUP and WM_KEYDOWN. I use this little keyboard thingy:
Code:
struct keyboard
{
keyboard( void );
~keyboard( void );
operator BYTE *();
operator const BYTE *() const;
const BYTE * begin() const;
BYTE * begin();
const BYTE * end() const;
BYTE * end();
private:
BYTE keys[256];
};
And when I recieve a WM_KEYDOWN or WM_KEYUP, I toggle my my_keyboard[wParam]value. It would appear as though when I am in a rush and sort of hitting the spacebar a lot, then it gets locked thinking it's down. Is there a better way of collecting user input?
Also peculiar is that I have the a 'keyboard' associated with each instance of a window. I have multiple instances of some window at once right now, but this seems kind of peculiar if I were to move this class over to a plain GUI application.
Any better way of doing this? This is for a game, but it is related to windows, so whatever.