   Input fun
  I''m using SDL to get input.The way my game works right now is it gets the current key states for all the keys, then it goes and does something like this:if (keys[UP])    Ship->GoUp();else if (keys[DOWN])    Ship->GoDown();But now lets say I''m trying to make a console. If I get input that way, then pressing a key makes it type in something like this:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa_even when I press "a" for just an instant.So how should I get around this?  
  so, currently you have a function that loads the "keys" array with true values, with it''s index equivalent to key codes, when you press a key, right?Do you have a function that changes those true values to false when the key is released? I bet that''s the problem, you''re just forgetting to tell the program the key was released.However, I would use a slightly different approach. Your current "keys" array could technically tell us when every singal key is pressed. The problem is, it''s very memory intensive, and running through it to check every key is slow. Instead, I would use a stack that stores the keycodes of the keys that are currently depressed. Push the keycode when a key is pressed, and pop the keycode when the key is released. You could limit your stack size to maybe 5 keys, you really don''t need that many.  ;  I believe the problem lies in the fact that you check the keyboard buffer every frame, which will be many times a second, so if you hit a key for like 1 second you will print as many characters to your console as you have frames per second.For your console it would be much better to only print characters after recieving a WM_KEYUP event in the message loop. Runicsoft -- home of my open source Function Parser and more ;  What does WM_KEYUP do exually?Is it possible DirectInput has a function to handle that?  ;  Input can be a pain, to take the raw information the computer is giving you and making heads or tails out of it.There''s many approaches. If you just want to know the instant a button is pressed, a flag can help.if(key[UP] && !upChecked){    Ship->GoUp();    upChecked = true;}if(!key[UP])    upChecked = false;If you want predefined input as long as a button is held down, then just use button presses and releases to toggle a flagif(key[UP])    upIsDown = true;else    upIsDown = false;if(upIsDown)    //do some predefined, key repeat independent thing    //like fire a constant laser or somethingthere''s a lot of other things you can do. Interpreting input just right can take a bit of finessing.  