Add CTRL-B shortcut to boot OS directly from edit menu
All checks were successful
Builds / ExectOS (amd64, debug) (push) Successful in 35s
Builds / ExectOS (i686, release) (push) Successful in 30s
Builds / ExectOS (amd64, release) (push) Successful in 32s
Builds / ExectOS (i686, debug) (push) Successful in 34s

This commit is contained in:
Aiken Harris 2025-09-01 12:43:33 +02:00
parent 34cebf2810
commit 2d1b6363e6
Signed by: harraiken
GPG Key ID: C40F06CB7493C1F5

View File

@ -395,6 +395,7 @@ BlDisplayEditMenu(IN PXTBL_BOOTMENU_ITEM MenuEntry)
UINT_PTR EventIndex; UINT_PTR EventIndex;
PWCHAR NewValue, OptionName, OriginalValue, Value, ValueToEdit; PWCHAR NewValue, OptionName, OriginalValue, Value, ValueToEdit;
CONST PWCHAR *EditableOptions; CONST PWCHAR *EditableOptions;
EFI_STATUS Status;
/* Draw edit menu */ /* Draw edit menu */
BlpDrawEditMenu(&Handle); BlpDrawEditMenu(&Handle);
@ -595,6 +596,27 @@ BlDisplayEditMenu(IN PXTBL_BOOTMENU_ITEM MenuEntry)
RedrawEntries = TRUE; RedrawEntries = TRUE;
} }
} }
else if(Key.UnicodeChar == 0x02)
{
/* CTRL-B key pressed, boot the OS */
BlSetConsoleAttributes(Handle.DialogColor | Handle.TextColor);
BlClearConsoleLine(Handle.PosY + Handle.Height + 4);
BlSetCursorPosition(4, Handle.PosY + Handle.Height + 4);
BlConsolePrint(L"Booting '%S' now...\n", MenuEntry->FullName);
/* Boot the OS */
Status = BlInvokeBootProtocol(MenuEntry->ShortName, MenuEntry->Options);
if(Status != STATUS_SUCCESS)
{
/* Failed to boot OS */
BlDebugPrint(L"ERROR: Failed to boot '%S' (Status Code: 0x%zX)\n", MenuEntry->FullName, Status);
BlDisplayErrorDialog(L"XTLDR", L"Failed to startup the selected Operating System.");
RedrawEditMenu = TRUE;
}
/* Return to the edit menu */
continue;
}
else if(Key.ScanCode == 0x17) else if(Key.ScanCode == 0x17)
{ {
/* ESC key pressed, exit edit menu */ /* ESC key pressed, exit edit menu */
@ -1683,7 +1705,7 @@ BlpDrawEditMenu(OUT PXTBL_DIALOG_HANDLE Handle)
BlSetCursorPosition(0, Handle->PosY + Handle->Height); BlSetCursorPosition(0, Handle->PosY + Handle->Height);
BlSetConsoleAttributes(EFI_TEXT_BGCOLOR_BLACK | EFI_TEXT_FGCOLOR_LIGHTGRAY); BlSetConsoleAttributes(EFI_TEXT_BGCOLOR_BLACK | EFI_TEXT_FGCOLOR_LIGHTGRAY);
BlConsolePrint(L" Use cursors to change the selection. Press ENTER key to edit the chosen\n" BlConsolePrint(L" Use cursors to change the selection. Press ENTER key to edit the chosen\n"
L" option or ESC to return to the main boot menu."); L" option, ESC to return to the main boot menu or CTRL-B to boot.\n");
} }
/** /**