title: Problem with kbhit()[and getch()] for Linux
body: <pre><code>while(ch != 'q') 
  {
    printf("looping\n");
    sleep(1);
    if(kbhit()) 
     {
      ch = readch();
      printf("you hit %c\n",ch);
     }
  }
  </code></pre>
  
  <p>This code gives me a blocking getch() like functionality. I am trying to use this code to capture up down arrow keys.</p>
  
  <p><strong>Added:</strong>
  Trying to capture key codes of up arrow gives me 3 chars 27, 91 and 65.
  Using if/else I am trying pattern matching but I only get 2 chars. Next one is captured when next key is pressed.</p>
  
  <p>I want to capture full words using getchar() while always looking for certain keys all the time(esc, del etc.).</p>