Page 1 of 1

ExamineKeyboard() and timing question

Posted: Tue Oct 12, 2004 5:44 pm
by tony_bruguier
Hi all,

I looked a the sniped provided with PureBasic that uses DirectX (sprite.pb). I had a question about ExamineKeyboard(). If the key press happens when the program is busy doing something else, will I receive the event the next time I call ExamineKeyboard()?

It's just that when I was programming on my good ol' Macintosh, we had two functions. One, slow, that was bufferized and remembered the events, and a fast one that did not remember.

I hope I was clear about this...
Thanks for your help,
Tony

Posted: Thu Oct 14, 2004 2:30 am
by waffle
the short answer is NO.
It does not remember keypresses.

However, keep this in mind:

ExamineKeyboard()
examines the keyboard state at that time,
All keypress() calls are checked against this state.
So, if you never ExamineKeyboard() again,
the state will apear to remain the same.

Sorta annoying when tracing in debug mode, because I don't think
ExamineKeyboard() actually examines the keyboard on
subsequent checks while in debug mode and stepping your app.