]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
menu: Move shortcut-key handling to bootmenu_loop()
authorSimon Glass <sjg@chromium.org>
Fri, 13 Feb 2026 13:39:09 +0000 (06:39 -0700)
committerTom Rini <trini@konsulko.com>
Tue, 3 Mar 2026 16:34:52 +0000 (10:34 -0600)
The bootmenu_conv_key() function is shared with expo subsystem for key
input. Adding alphanumeric-to-BKEY_SHORTCUT conversion there causes expo
to swallow typed characters instead of inserting them as text, since
BKEY_SHORTCUT falls in the range that expo treats as a command key
rather than passing through.

Move the shortcut-key detection into bootmenu_loop() where it is
only used in the bootmenu context.

Fixes: 8c986521c3c9 ("cmd: bootmenu: permit to select bootmenu entry with a shortcut")
Signed-off-by: Simon Glass <simon.glass@canonical.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
common/menu.c

index ae5afa147660bdb7c49f58ea6ab019ec93a9bf10..02df3b8f133ab15f65d6f12386443d21fa96ddb7 100644 (file)
@@ -556,11 +556,6 @@ enum bootmenu_key bootmenu_conv_key(int ichar)
        case ' ':
                key = BKEY_SPACE;
                break;
-       case 'A' ... 'Z':
-       case 'a' ... 'z':
-       case '0' ... '9':
-               key = BKEY_SHORTCUT;
-               break;
        default:
                key = BKEY_NONE;
                break;
@@ -591,8 +586,10 @@ enum bootmenu_key bootmenu_loop(struct bootmenu_data *menu,
 
        key = bootmenu_conv_key(c);
 
-       if (key == BKEY_SHORTCUT)
+       if (key == BKEY_NONE && isalnum(c)) {
+               key = BKEY_SHORTCUT;
                cch->shortcut_key = bootmenu_conv_shortcut_key(menu, c);
+       }
 
        return key;
 }