mirror of
https://github.com/xcat2/xNBA.git
synced 2025-01-18 21:43:14 +00:00
- works with test ansi tty, but will need a rethink when we start
getting key_ codes instead
This commit is contained in:
parent
f78fa3c59d
commit
11e280670d
@ -94,7 +94,8 @@ int wgetnstr ( WINDOW *win, char *str, int n ) {
|
||||
|
||||
_str = str;
|
||||
|
||||
while ( ( ( c = wgetch( win ) ) != '\n' ) && !( n == 0 ) ) {
|
||||
while (!( n == 0 ) ) {
|
||||
c = wgetch( win );
|
||||
if ( c >= 0401 && c <= 0633 ) {
|
||||
switch(c) {
|
||||
case KEY_LEFT :
|
||||
@ -107,7 +108,10 @@ int wgetnstr ( WINDOW *win, char *str, int n ) {
|
||||
*_str = '\0';
|
||||
break;
|
||||
}
|
||||
} else { // *should* only be ASCII chars now
|
||||
} else if ( c == '\n' ) {
|
||||
*_str = '\0';
|
||||
break;
|
||||
}else { // *should* only be ASCII chars now
|
||||
*(_str++) = (char)c;
|
||||
n--;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user