title: Inputs in SDL (on key pressed)
body: <p>I would like to know how can I detect the press of a key or release of a key in a while loop in SDL. Now, I know you can get the events with SDL like OnKeyPressed, OnKeyReleased, OnKeyHit, etc, but I want to know how to build functions like 'KeyPressed' that returns a boolean, instead of being an event. Example:</p>
  
  <pre><code>while not KeyHit( KEY_ESC ) 
  {
  //Code here
  }
  </code></pre>