menu: Support using 1-9 to boot menu entries

This commit is contained in:
mintsuki 2022-02-04 22:25:34 +01:00
parent 7d70e31258
commit aae5e6f779
2 changed files with 24 additions and 13 deletions

26
.gitignore vendored
View File

@ -3,19 +3,19 @@
/toolchain
/reduced-gnu-efi
/ovmf*
/*.o
/*.d
/*.a
/*.exe
/*.EFI
/*.bin
/*.bin.gz
/*.tar.xz
/*.tar.gz
/*.elf
/*.hdd
/*.iso
/*.sys
*.o
*.d
*.a
*.exe
*.EFI
*.bin
*.bin.gz
*.tar.xz
*.tar.gz
*.elf
*.hdd
*.iso
*.sys
/bochsout.txt
/bx_enh_dbg.ini
/.vscode

View File

@ -821,6 +821,17 @@ refresh:
c = getchar();
timeout_aborted:
switch (c) {
case '1': case '2': case '3': case '4': case '5':
case '6': case '7': case '8': case '9': {
int ent = (c - '0') - 1;
if (ent < (int)max_entries) {
selected_entry = ent;
print_tree(NULL, 0, 0, selected_entry, menu_tree,
&selected_menu_entry);
goto autoboot;
}
goto refresh;
}
case GETCHAR_CURSOR_UP:
if (selected_entry == 0)
selected_entry = max_entries - 1;