title: Escape key press infinite loop in C
body: <p>I am using curses library. I want my application to keep on executing till Escape key is pressed. It should not block for next key input,</p>
  
  <p>My working code is: This waits for user input at key=getch(); I want this to be non-blocking till someone presses ESCAPE KEY.
  It should not wait for keyboard input.</p>
  
  <pre><code>while (true)
  {
      key=getch();
      if (key==ESCAPE)
      {
          break;
      }
      //else
      //{
          //execute something 
      //}
  }//while end
  </code></pre>