From f8157a3971dad18f798a1eab499a0640ac5b879f Mon Sep 17 00:00:00 2001 From: Fredrik Holmqvist Date: Sun, 31 Jan 2021 21:44:48 +0100 Subject: [PATCH] UEFI Console, easier spacebar for bootmenu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Idf68b738168fbb59d000c1f0f0771c8351bc70ab Reviewed-on: https://review.haiku-os.org/c/haiku/+/3725 Reviewed-by: Fredrik Holmqvist Reviewed-by: Axel Dörfler --- src/system/boot/platform/efi/console.cpp | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/system/boot/platform/efi/console.cpp b/src/system/boot/platform/efi/console.cpp index 850cc15a1b..1c0fea642f 100644 --- a/src/system/boot/platform/efi/console.cpp +++ b/src/system/boot/platform/efi/console.cpp @@ -231,22 +231,23 @@ console_init(void) uint32 console_check_boot_keys(void) { - efi_status status; efi_input_key key; - // give the user a chance to press a key - kBootServices->Stall(500000); + for (int i = 0; i < 3; i++) { + // give the user a chance to press a key + kBootServices->Stall(100000); - status = kSystemTable->ConIn->ReadKeyStroke(kSystemTable->ConIn, &key); + efi_status status = kSystemTable->ConIn->ReadKeyStroke( + kSystemTable->ConIn, &key); - if (status != EFI_SUCCESS) - return 0; - - if (key.UnicodeChar == 0 && key.ScanCode == SCAN_ESC) - return BOOT_OPTION_DEBUG_OUTPUT; - if (key.UnicodeChar == ' ') - return BOOT_OPTION_MENU; + if (status != EFI_SUCCESS) + continue; + if (key.UnicodeChar == 0 && key.ScanCode == SCAN_ESC) + return BOOT_OPTION_DEBUG_OUTPUT; + if (key.UnicodeChar == ' ') + return BOOT_OPTION_MENU; + } return 0; }