keyboard buffer

BlitzMax Forums/BlitzMax Programming/keyboard buffer

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Yes I know about those commands maybe I didn't explain well enough.

If you look at an Ascii table and then the Blitz key codes you'll notice that they're similar, but not the same.

When you use KeyHit() and KeyDown() the values are given as key codes.

To poll the whole keyboard is 100+ checks every loop. Now there's a command called GetChar() that returns the next character in the key buffer.

In other words if I hit 'a' 5 times I can read from the buffer until it's empty instead of checking every key. Also The order the keys is pressed can be preserved. There are 2 problems with this command.

1) GetChar() returns the Ascii code so Asc("a") = 97 <> Asc("A") = 65 while they are the same in keycodes. This can be worked around, but it's annoying.

2) The bigger problem is that seemingly only ascii codes 0-127 are supported by GetChar() so things like the directional arrows and the F1-F12 buttons can't be read from the buffer.

Anyway I don't think there's an easy solution, but the gui mod might provide a fuller input implementation.