title: Create a function to check for key press in Unix using ncurses
body: <p>I have been looking for an equivalent to <code>kbhit()</code> and I have read several forums on this subject, and the majority seem to suggest using ncurses.</p>
  <p>How should I go about checking if a key is pressed in C++ using ncurses?</p>
  <p>The function <code>getch()</code> provided by ncurses reads a character from the window.
  I would like to write a function that only checks if there is a key press and then I want to do <code>getch()</code>.</p>