Original Post
I'm looking for some simple way of making sure my game doesn't receive a new input for the same key press. Currently I'm using a static bool for the job, but is there a more straightforward method? Something that could be used in a function so I can write something more clear than this and avoid redundant code would be nice. Thanks. (And that is the tag for posting code?
//Key is a char
static bool KeyPressed = false;
if(!DInput->KeyDown(key))
KeyPressed = false;
else if(KeyPressed == false){
KeyPressed = true;
/*Code here*/
}
?)