ncurses backspace

From: leonard (lg_at_cgl-os.org)
Date: 08/25/05


Date: Thu, 25 Aug 2005 19:00:21 +1200

Hi

I can't get my program to read the backspace key.
here is my code;

  initscr();
  noecho();
  cbreak();
  keypad(stdscr, TRUE);

  while ((ch = getch()) != KEY_F(1)) {
      switch (ch) {
         case KEY_BACKSPACE;
             delch(ch);
             continue;
         case KEY_UP;
              ...
         case KEY_DOWN;
              ...

And when I run the program I get ^? when I press
the backspace key. All the other keys work.