Browse Source

- works with test ansi tty, but will need a rethink when we start

getting key_ codes instead
tags/v0.9.3
Dan Lynch 18 years ago
parent
commit
11e280670d
1 changed files with 6 additions and 2 deletions
  1. 6
    2
      src/hci/mucurses/kb.c

+ 6
- 2
src/hci/mucurses/kb.c View File

94
 
94
 
95
 	_str = str;
95
 	_str = str;
96
 
96
 
97
-	while ( ( ( c = wgetch( win ) ) != '\n' ) && !( n == 0 ) ) {
97
+	while (!( n == 0 ) ) {
98
+		c = wgetch( win );
98
 		if ( c >= 0401 && c <= 0633 ) {
99
 		if ( c >= 0401 && c <= 0633 ) {
99
 			switch(c) {
100
 			switch(c) {
100
 			case KEY_LEFT :
101
 			case KEY_LEFT :
107
 				*_str = '\0';
108
 				*_str = '\0';
108
 				break;
109
 				break;
109
 			}
110
 			}
110
-		} else { // *should* only be ASCII chars now
111
+		} else if ( c == '\n' ) {
112
+			*_str = '\0';
113
+			break;
114
+		}else { // *should* only be ASCII chars now
111
 			*(_str++) = (char)c;
115
 			*(_str++) = (char)c;
112
 			n--;
116
 			n--;
113
 		}
117
 		}

Loading…
Cancel
Save