[PATCH v2 32/36] expo: Support handling any key in cedit

Simon Glass sjg at chromium.org
Mon Oct 2 03:13:36 CEST 2023


At present cedit only supports menu keys. For textline objects we need
to insert normal ASCII characters.

We also need to handle backspace, which is ASCII 9.

In fact, expo does not make use of all the menu keys, so partition
them accordingly and update the logic to support normal ASCII
characters, too.

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

(no changes since v1)

 boot/cedit.c   | 2 +-
 include/menu.h | 7 ++++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/boot/cedit.c b/boot/cedit.c
index bb194af77bdc..407793aaddd4 100644
--- a/boot/cedit.c
+++ b/boot/cedit.c
@@ -176,7 +176,7 @@ int cedit_run(struct expo *exp)
 		key = 0;
 		if (ichar) {
 			key = bootmenu_conv_key(ichar);
-			if (key == BKEY_NONE)
+			if (key == BKEY_NONE || key >= BKEY_FIRST_EXTRA)
 				key = ichar;
 		}
 		if (!key)
diff --git a/include/menu.h b/include/menu.h
index 64ce89b7d263..6571c39b1430 100644
--- a/include/menu.h
+++ b/include/menu.h
@@ -50,12 +50,17 @@ enum bootmenu_key {
 	BKEY_DOWN,
 	BKEY_SELECT,
 	BKEY_QUIT,
+	BKEY_SAVE,
+
+	/* 'extra' keys, which are used by menus but not cedit */
 	BKEY_PLUS,
 	BKEY_MINUS,
 	BKEY_SPACE,
-	BKEY_SAVE,
 
 	BKEY_COUNT,
+
+	/* Keys from here on are not used by cedit */
+	BKEY_FIRST_EXTRA = BKEY_PLUS,
 };
 
 /**
-- 
2.42.0.582.g8ccd20d70d-goog



More information about the U-Boot mailing list