[Teton] Handle Tab and Backspace.

This commit is contained in:
Drew Galbraith 2023-11-26 13:21:04 -08:00
parent f01b447af4
commit 134185117d
2 changed files with 12 additions and 0 deletions

View File

@ -102,6 +102,8 @@ void KeyboardListenerBase::HandleKeycode(Keycode code, Action action) {
c = ' ';
} else if (code == kTab) {
c = '\t';
} else if (code == kBackspace) {
c = '\b';
} else if (code == kLShift) {
lshift_ = true;
} else if (code == kRShift) {

View File

@ -7,6 +7,16 @@ void Console::WriteChar(char c) {
CursorReturn();
return;
}
if (c == '\t') {
WriteString(" ");
return;
}
if (c == '\b') {
cursor_pos_--;
WriteChar(' ');
cursor_pos_--;
return;
}
uint64_t row = cursor_pos_ / cols();
if (row >= rows()) {