diff --git a/kernel/drivers/keyboard/keycodes.c b/kernel/drivers/keyboard/keycodes.c index 545dda1..c18d288 100644 --- a/kernel/drivers/keyboard/keycodes.c +++ b/kernel/drivers/keyboard/keycodes.c @@ -31,6 +31,9 @@ typedef enum keycode_enum { KEYCODE_SPACE = ' ', + KEYCODE_BACKSPACE = 0x08, + KEYCODE_NEWLINE = '\n', + KEYCODE_SHIFT_UP, KEYCODE_SHIFT_DOWN, KEYCODE_CAPS_UP, diff --git a/kernel/drivers/keyboard/keymaps/DUMMY_azerty.c b/kernel/drivers/keyboard/keymaps/DUMMY_azerty.c index 1665995..6d9fa6d 100644 --- a/kernel/drivers/keyboard/keymaps/DUMMY_azerty.c +++ b/kernel/drivers/keyboard/keymaps/DUMMY_azerty.c @@ -72,6 +72,10 @@ keycode get_keycode(unsigned char scancode) { return KEYCODE_CAPS_DOWN; case 0xba: return KEYCODE_CAPS_UP; + case 0x0e: + return KEYCODE_BACKSPACE; + case 0x1c: + return KEYCODE_NEWLINE; default: return KEYCODE_UNKNOWN; } diff --git a/kernel/terminal.c b/kernel/terminal.c index 1b242f9..40e51e3 100644 --- a/kernel/terminal.c +++ b/kernel/terminal.c @@ -76,6 +76,18 @@ void terminal_putchar(char c) { terminal_row++; return; } + if (c == 0x08) { + if (terminal_column == 0) { + if(terminal_row != 0) { + terminal_row--; + terminal_column = VGA_WIDTH - 1; + } + } else { + terminal_column--; + } + terminal_putentryat(' ', terminal_color, terminal_column, terminal_row); + return; + } terminal_putentryat(c, terminal_color, terminal_column, terminal_row); if (++terminal_column == VGA_WIDTH) {