Skip to content

Commit

Permalink
ui/Keys: add KEY_BACKSPACE3 and KEY_LINEFEED
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxKellermann committed Sep 9, 2024
1 parent 54dc429 commit e781edf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/ui/Keys.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
enum : int {
KEY_BACKSPACE2 = 8,
KEY_TAB = 9,
KEY_LINENEED = '\n',
KEY_RETURN = '\r',
KEY_ESCAPE = 0x1b,
KEY_BACKSPACE3 = 0x7f,
};
4 changes: 2 additions & 2 deletions src/wreadln.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ _wreadln(const Window window,
wr.DeleteChar();
}
break;
case 127:
case KEY_BACKSPACE3:
case KEY_BACKSPACE2: /* handle backspace: copy all */
case KEY_BACKSPACE: /* chars starting from curpos */
if (wr.cursor > 0) { /* - 1 from buf[n+1] to buf */
Expand Down Expand Up @@ -412,7 +412,7 @@ _wreadln(const Window window,
wr.MoveCursorToEnd();
break;

case '\n':
case KEY_LINENEED:
case KEY_RETURN:
case KEY_IC:
case KEY_PPAGE:
Expand Down

0 comments on commit e781edf

Please sign in to comment.