diff mbox series

[3/6] bootmenu: Cancel delay only when a real key is pressed

Message ID 20230617104956.1402370-4-sjg@chromium.org
State Deferred
Delegated to: Tom Rini
Headers show
Series nokia_nx51: Attempts to debug keyboard | expand

Commit Message

Simon Glass June 17, 2023, 10:49 a.m. UTC
We need to decode the input character before deciding if it is a real
key, or just part of an escape sequence. Check this.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 common/menu.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/common/menu.c b/common/menu.c
index b55cf7b99967..c81494b3d1f3 100644
--- a/common/menu.c
+++ b/common/menu.c
@@ -446,11 +446,14 @@  enum bootmenu_key bootmenu_autoboot_loop(struct bootmenu_data *menu,
 				continue;
 			}
 
-			menu->delay = -1;
 			c = getchar();
 
 			ichar = cli_ch_process(cch, c);
 
+			if (!ichar)
+				continue;
+			menu->delay = -1;
+
 			switch (ichar) {
 			case '\0':
 				key = BKEY_NONE;