Basic support the backspace key.

This doesn't mean we get any line editing just yet. But the keyboard device
now recognizes the backspace key, and the console device knows what to do
with the backspace characters.
This commit is contained in:
Andreas Kling 2018-10-30 11:55:58 +01:00
commit bd2b5327d0
Notes: sideshowbarker 2024-07-19 18:36:35 +09:00
2 changed files with 9 additions and 1 deletions

View file

@ -303,6 +303,14 @@ void Console::putChar(char ch)
case '\033':
m_escState = ExpectBracket;
return;
case 8: // Backspace
if (m_cursorColumn) {
--m_cursorColumn;\
vga_set_cursor(m_cursorRow, m_cursorColumn);
vga_putch_at(m_cursorRow, m_cursorColumn, ' ');
return;
}
break;
case '\n':
scrollup();
vga_set_cursor(m_cursorRow, m_cursorColumn);