menu: Start bootmenu_key values at 0x100

At present the backspace key (Ctrl-B) has the same value as BKEY_UP,
which means the keys are ambiguous. This causes problems when trying
to edit a textline. The same problem applies to other keys used in
cread_line_process_ch()

Start the bootmenu_key enum values at 0x100 to avoid this collision.
Keep BKEY_NONE as 0, since it is a sentinel value.

Co-developed-by: Claude <claude@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
This commit is contained in:
Simon Glass
2025-12-07 06:47:43 -07:00
parent 21f4b4d8dc
commit 9ef0ac6ff2

View File

@@ -45,10 +45,16 @@ struct bootmenu_data {
struct bootmenu_entry *first; /* first menu entry */
};
/** enum bootmenu_key - keys that can be returned by the bootmenu */
/**
* enum bootmenu_key - keys that can be returned by the bootmenu
*
* These values start at 0x100 to avoid colliding with ASCII control characters
* (0x01-0x1f) which are used for editing operations in textlines. BKEY_NONE is
* kept at 0 as a sentinel value.
*/
enum bootmenu_key {
BKEY_NONE = 0,
BKEY_UP,
BKEY_UP = 0x100,
BKEY_DOWN,
BKEY_SELECT,
BKEY_QUIT,