From 8f45cf6ad06dc4efed7b7070cf755ed9d6ad1eea Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 24 Jun 2020 20:21:37 +0200 Subject: Base: added tty handling of \b and \r --- src/pOS/arch/x86/kernel/drivers/keyboard/kbbuf.cpp | 6 ++---- src/pOS/arch/x86/kernel/tty.cpp | 9 ++++++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/pOS/arch/x86/kernel/drivers/keyboard/kbbuf.cpp b/src/pOS/arch/x86/kernel/drivers/keyboard/kbbuf.cpp index ceac96b..0892865 100644 --- a/src/pOS/arch/x86/kernel/drivers/keyboard/kbbuf.cpp +++ b/src/pOS/arch/x86/kernel/drivers/keyboard/kbbuf.cpp @@ -19,13 +19,10 @@ int KB_BUF::scan(unsigned char code) switch(code) { + /* IMPLEMENT WITH SIG CODES */ case ESC: break; - case BACKSPACE: - TTY::tty_delete(1); - break; - case UP_ARROW: if(shifted) TTY::tty_scroll(+1); @@ -47,6 +44,7 @@ int KB_BUF::scan(unsigned char code) else TTY::tty_cursor_move(0, +1); break; + /* IMPLEMENT WITH SIG CODES */ case LSHIFT_PRESS: case RSHIFT_PRESS: diff --git a/src/pOS/arch/x86/kernel/tty.cpp b/src/pOS/arch/x86/kernel/tty.cpp index fc796bd..f82fd5e 100644 --- a/src/pOS/arch/x86/kernel/tty.cpp +++ b/src/pOS/arch/x86/kernel/tty.cpp @@ -81,7 +81,14 @@ int TTY::tty_putentryat(unsigned char c, uint8_t color, size_t x, size_t y) { tty_x += TAB_INDENTATION; tty_map[x][y] = VGA::vga_entry(' ', color); - } //add \r, delete etc + } + else if(c == '\b') + { + TTY::tty_delete(1); + tty_x--; + } + else if(c == '\r') + tty_x = 0; else tty_map[x][y] = VGA::vga_entry(c, color); -- cgit 1.4.1