[PATCH v13 3/9] menu: add KEY_PLUS, KEY_MINUS and KEY_SPACE handling

Masahisa Kojima masahisa.kojima at linaro.org
Wed Aug 24 08:37:34 CEST 2022


This is preparation to support menu-driven UEFI BootOrder
variable updated by KEY_PLUS, KEY_MINUS and KEY_SPACE.

Signed-off-by: Masahisa Kojima <masahisa.kojima at linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas at linaro.org>
---
No update since v11

Changes in v11:
- add SPACE key handling

Newly created in v7

 common/menu.c  | 9 +++++++++
 include/menu.h | 3 +++
 2 files changed, 12 insertions(+)

diff --git a/common/menu.c b/common/menu.c
index 3e876b55b3..0d19601cf5 100644
--- a/common/menu.c
+++ b/common/menu.c
@@ -548,4 +548,13 @@ void bootmenu_loop(struct bootmenu_data *menu,
 	/* ^C was pressed */
 	if (c == 0x3)
 		*key = KEY_QUIT;
+
+	if (c == '+')
+		*key = KEY_PLUS;
+
+	if (c == '-')
+		*key = KEY_MINUS;
+
+	if (c == ' ')
+		*key = KEY_SPACE;
 }
diff --git a/include/menu.h b/include/menu.h
index e74616cae8..702aacb170 100644
--- a/include/menu.h
+++ b/include/menu.h
@@ -48,6 +48,9 @@ enum bootmenu_key {
 	KEY_DOWN,
 	KEY_SELECT,
 	KEY_QUIT,
+	KEY_PLUS,
+	KEY_MINUS,
+	KEY_SPACE,
 };
 
 void bootmenu_autoboot_loop(struct bootmenu_data *menu,
-- 
2.17.1



More information about the U-Boot mailing list