summaryrefslogtreecommitdiffstats
path: root/src/tests
diff options
context:
space:
mode:
authorDan Lynch2006-06-28 13:50:02 +0200
committerDan Lynch2006-06-28 13:50:02 +0200
commitf9887c3f0f3591d8091c65d071c82b1190195359 (patch)
treed12b9cd8a5f8922087e9c16cd0318014a9c4603d /src/tests
parent- implemented cursor retreat function (_wcursback) as a core function (diff)
downloadipxe-f9887c3f0f3591d8091c65d071c82b1190195359.tar.gz
ipxe-f9887c3f0f3591d8091c65d071c82b1190195359.tar.xz
ipxe-f9887c3f0f3591d8091c65d071c82b1190195359.zip
started on ANSI sequence processing
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/curses_scr.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/tests/curses_scr.c b/src/tests/curses_scr.c
index 6c298976..398b9cf9 100644
--- a/src/tests/curses_scr.c
+++ b/src/tests/curses_scr.c
@@ -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 ) {