summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2017-06-09 08:34:46 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2017-06-09 08:34:46 +0200
commit54f6d24ecc7868a8fb5e4966b5c5a90231c9d121 (patch)
treeabfceff948b150019df356ab17a48cc6d7434bef
parenta9fb7392432a6062c6de3478514d6e51d250a999 (diff)
downloadabaos-54f6d24ecc7868a8fb5e4966b5c5a90231c9d121.tar.gz
abaos-54f6d24ecc7868a8fb5e4966b5c5a90231c9d121.tar.bz2
added backspace handling in pre-boot cli (sort of)
-rw-r--r--src/kernel.c5
-rw-r--r--src/keyboard.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/src/kernel.c b/src/kernel.c
index f9e695f..3f873ef 100644
--- a/src/kernel.c
+++ b/src/kernel.c
@@ -162,6 +162,11 @@ static void handle_keyboard_event( keyboard_event_t *event, void *context )
} else {
printf( "ERR: Unknown pre-boot command '%s'\n", buf );
}
+ } else if( event->ascii_key == '\b' ) {
+ if( pos > 0 ) {
+ buf[--pos] = '\0';
+ printf( "\n%s", buf );
+ }
} else {
printf( "%c", event->ascii_key );
buf[pos++] = event->ascii_key;
diff --git a/src/keyboard.c b/src/keyboard.c
index f132dfc..d7d8d88 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -161,7 +161,7 @@ typedef enum {
static char scancode_map[4][128] = {
{
0, 0, '1', '2', '3', '4', '5', '6',
- '7', '8', '9', '0', '-', '=', 0, 0,
+ '7', '8', '9', '0', '-', '=', '\b', 0,
'q', 'w', 'e', 'r', 't', 'y', 'u', 'i',
'o', 'p', '[', ']', '\n', 0, 'a', 's',
'd', 'f', 'g', 'h', 'j', 'k', 'l', ';',