   Single input per press?
  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?//Key is a charstatic bool KeyPressed = false;if(!DInput-&gt;KeyDown(key))KeyPressed = false;else if(KeyPressed == false){KeyPressed = true;/*Code here*/}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? ?)
  Seeing as that looks like Windows code, then just handle WM_KEYDOWN messages. The code tags are [code] for short code segments and [source] for long code segments. Capitalization is important.   ;  Is that enough? So pressing ESC wont hide/show continuously the menu until the user lets go of the button? And what about uses where I need several inputs like in an FPS game with WASD?   ;  If you want to see if the WM_KEYDOWN message is a repeat check bit 30 of the lparam. I'm not sure what you're asking for the second question.   ;  Thanks, I will look into that. You answered both questions in one answerNew problem, I would prefer not using a macro since we have an STL bit checker, but I'm not sure how I would use std::bitset in this situation.http://www.cppreference.com/wiki/stl/bitset/start[Edited by - Psykocyber on June 14, 2009 5:38:43 PM];  You can initialize a bitset with an integral type and check individual bits using operator[]. Ex:  int x = 0xdeadbeef;  std::bitset<32> bs(x);  for (int i = 0; i < 32; i++) {    std::cout << bs;  }