From: Dr. N. <dow...@gm...> - 2008-08-21 20:12:20
|
Elias Pschernig wrote: > No, key[] is always modified, but if your program is too slow in > checking, it may very well miss the change, for example: > > your-program-checks: key[KEY_A] == 0 > a-key-pressed -> key[KEY_A] = 1 > a-key-released -> key[KEY_A] = 0 > your-program-checks: key[KEY_A] == 0 > > Now it will seem to your program that the a-key was never pressed, but > this is by design and how key[] always has worked - your program simply > was too sow. Actually, this description does not quite seem to explain what I have observed. Sometimes when there are lots of programs running in the background on a slow computer, and my program is not too simple, I find that I occasionally get a delayed response to a key even if I hold it down. It might have something to do with the fact that I am using the arrow keys on the numerical keypad, and it might also have something to do with the fact that I often switch from one arrow key to another quite rapidly. Am I observing the expected behavior, or is there a problem? |