title: getch() of ncurses doesn't work
body: <p>I need to create a mainloop for my program and wrote the following function: </p>
  
  <pre><code>void menu(){
  int ch;
  cbreak();
  noecho();
  initscr();
  refresh();
  while (ch != KEY_F(9)){
      ch = getch();
      cout &lt;&lt; ch &lt;&lt; endl;
      switch (ch){
          case KEY_F(1): add();
              break;
  
          case KEY_F(2): edit();
              break;
  
          case KEY_F(3):
              break;
  
          case KEY_F(4):
              break;
  
  
      }
  
  }
  
  endwin();
  </code></pre>
  
  <p>}</p>
  
  <p>But getch() doesn't work and print -1 in loop. how i do? 
  May i set special attr or call special func?</p>