Ok, GetKey() and WaitKey() return the scan code, as opposed to the ascii code, of the pressed key. Makes sense. But how come the value of the key is left in the queue, even if the value is placed in a variable (a = GetKey()). Shouldn't the queue be cleared after a value is 'popped' from it?
I know I can use FlushKeys(), but I was just wondering why this was done this way.
WaitChar(), I know, uses GetChar() to see if there are any keys in the buffer and this makes sense to me. But the other two, WaitKey() and KeyDown(<key>) were, I thought, 'immediate mode' commands that didn't use the buffer at all but simply tested the keyboard at that very moment, etc.
Am I making sense?
Thanks,
Russell
p.s. I think it should also be pointed out that not all of these input commands work as expected in a non-graphics mode (console).
I know I can use FlushKeys(), but I was just wondering why this was done this way.
WaitChar(), I know, uses GetChar() to see if there are any keys in the buffer and this makes sense to me. But the other two, WaitKey() and KeyDown(<key>) were, I thought, 'immediate mode' commands that didn't use the buffer at all but simply tested the keyboard at that very moment, etc.
Am I making sense?
Thanks,
Russell
p.s. I think it should also be pointed out that not all of these input commands work as expected in a non-graphics mode (console).