david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

[mucurses] Attempt to fix keypress processing logic

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown 2017-03-21 14:42:02 +02:00
parent d29e2d551c
commit 583d258b89
1 changed files with 3 additions and 4 deletions

View File

@ -103,7 +103,9 @@ int wgetnstr ( WINDOW *win, char *str, int n ) {
_wcursback( win );
wdelch( win );
} else {
if ( c >= KEY_MIN ) {
if ( c >= 32 && c <= 126 ) {
*(_str++) = c; n--;
} else {
switch(c) {
case KEY_LEFT :
case KEY_BACKSPACE :
@ -118,9 +120,6 @@ int wgetnstr ( WINDOW *win, char *str, int n ) {
break;
}
}
if ( c >= 32 && c <= 126 ) {
*(_str++) = c; n--;
}
}
}