david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

started on ANSI sequence processing

This commit is contained in:
Dan Lynch 2006-06-28 11:50:02 +00:00
parent c29c868475
commit f9887c3f0f
1 changed files with 22 additions and 1 deletions

View File

@ -2,6 +2,7 @@
#include <termios.h>
#include <stddef.h>
#include <stdio.h>
#include <string.h>
#define ESC 27
#define MODE 3
@ -46,7 +47,27 @@ void _putc( struct _curses_screen *scr __unused, chtype c ) {
}
int _getc( struct _curses_screen *scr __unused ) {
return getchar();
int c;
char buffer[16];
char *ptr;
c = getchar();
if ( c == '\n' )
return KEY_ENTER;
/*
WE NEED TO PROCESS ANSI SEQUENCES TO PASS BACK KEY_* VALUES
if ( c == ESC ) {
ptr = buffer;
while ( scr->peek( scr ) == TRUE ) {
*(ptr++) = getchar();
}
// ANSI sequences
if ( strcmp ( buffer, "[D" ) == 0 )
return KEY_LEFT;
}
*/
return c;
}
bool _peek( struct _curses_screen *scr __unused ) {