keyDown is an array of 255 elements of type bool indexed by the ASCII value of a character. When a key is pressed, keyboard() is entered which sets the required element of keyDown to true, and when key is released, keyboardUp() is entered which sets the required element of keydown to false. So the array keyDown determines which key(s) are down at any time.

Where in checkKeyboard() are you using this code? Where are you defining b? If this is from the suggested code in post #8 here http://forums.codeguru.com/showthrea...-for-quot-loop, then b is only available if the first if statement following the for is true for the block of the if statement.

It would be helpful if you posted all the code for the function checkKeyboard().