ExamineKeyboard() and timing question

Just starting out? Need help? Post your questions and find answers here.
tony_bruguier
User
User
Posts: 11
Joined: Mon Jun 21, 2004 11:38 pm
Location: Pasadena, CA
Contact:

ExamineKeyboard() and timing question

Post 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
User avatar
waffle
Enthusiast
Enthusiast
Posts: 129
Joined: Mon May 12, 2003 1:34 pm
Location: USA
Contact:

Post 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.
Code is good... Its an international language.
Post Reply