]> git.cworth.org Git - ttt/commitdiff
* src/ttt-curses-client.c Fixed backspace implementation
authorBryan Worth <bryan@theworths.org>
Thu, 8 Dec 2005 21:13:44 +0000 (21:13 +0000)
committerBryan Worth <bryan@theworths.org>
Thu, 8 Dec 2005 21:13:44 +0000 (21:13 +0000)
src/ttt-curses-client.c

index 23cd7d770f8f5696c444073dd7282bfaeed717ec..75f64187685627831d369b78653126b75552a81c 100644 (file)
 
 /* TODO: see /usr/share/doc/ncurses-devel-5.3/test/view.c for example code
  *      to handle window resizing
- *      
- *      add code to read username from config file or prompt user if config
- *      file does not exist. (username is currently hardcoded and needs
- *      changed before compiling)
  *
  */     
 
@@ -237,14 +233,27 @@ main (int argc, char **argv)
                    break;
                case 8:
                    inplin[strlen(inplin)-1]='\0';
-                   wmove(inpwin,0,strlen(inplin));
-                   wclrtoeol(inpwin);
+                   wmove (inpwin,0,strlen(inplin));
+                   wclrtoeol( inpwin);
+                   wrefresh (inpwin);
+                   break;
+               case 127:
+                   inplin[strlen(inplin)-1]='\0';
+                   wmove (inpwin,0,strlen(inplin));
+                   wclrtoeol (inpwin);
+                   wrefresh (inpwin);
+                   break;
+               case 263:
+                   inplin[strlen(inplin)-1]='\0';
+                   wmove (inpwin,0,strlen(inplin));
+                   wclrtoeol (inpwin);
+                   wrefresh (inpwin);
                    break;
                default: 
                    sprintf (inplin,"%s%c",inplin,(int) c);
                    waddch (inpwin, c);
+                   wrefresh (inpwin);
            }
-           wrefresh (inpwin);
        }
 
        if (fgets(buffer,BUFSIZ,sockin)) {