From e781edfb50591ae7621207892161abbba48e754a Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 9 Sep 2024 21:39:01 +0200 Subject: [PATCH] ui/Keys: add KEY_BACKSPACE3 and KEY_LINEFEED --- src/ui/Keys.hxx | 2 ++ src/wreadln.cxx | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ui/Keys.hxx b/src/ui/Keys.hxx index b84d50ed..726875d1 100644 --- a/src/ui/Keys.hxx +++ b/src/ui/Keys.hxx @@ -10,6 +10,8 @@ enum : int { KEY_BACKSPACE2 = 8, KEY_TAB = 9, + KEY_LINENEED = '\n', KEY_RETURN = '\r', KEY_ESCAPE = 0x1b, + KEY_BACKSPACE3 = 0x7f, }; diff --git a/src/wreadln.cxx b/src/wreadln.cxx index 62ef07ae..7920bccf 100644 --- a/src/wreadln.cxx +++ b/src/wreadln.cxx @@ -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 */ @@ -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: