Rapid Key Pressing

Blitz3D Forums/Blitz3D Beginners Area/Rapid Key Pressing

Why use the hard way when KeyHit will do nicely? Note with KeyHit: you should only check it once per frame. With KeyDown it is no problem to check it as many times as you want but KeyHit should only be checked once every time through the game loop.


You answered your own question. You can only check the state of the key once per loop with keyhit AND there is a possibility that if you check keydown more than once per loop, it might not be in the same state that it was earlier within the same loop (which, depending on how your code is written, might really bugger things up).

So, by doing it the "Hard Way", you can check the state of the key (TAB_held) as many times as you want per loop with no ill effects.