)\r
{\r
EFI_INPUT_KEY Enter;\r
- EFI_INPUT_KEY F2;\r
+ EFI_INPUT_KEY CustomKey;\r
EFI_INPUT_KEY Down;\r
EFI_BOOT_MANAGER_LOAD_OPTION BootOption;\r
EFI_STATUS Status;\r
Enter.UnicodeChar = CHAR_CARRIAGE_RETURN;\r
EfiBootManagerRegisterContinueKeyOption (0, &Enter, NULL);\r
\r
- //\r
- // Map F2 to Boot Manager Menu\r
- //\r
- F2.ScanCode = SCAN_F2;\r
- F2.UnicodeChar = CHAR_NULL;\r
+ if (FixedPcdGetBool (PcdBootManagerEscape)) {\r
+ //\r
+ // Map Esc to Boot Manager Menu\r
+ //\r
+ CustomKey.ScanCode = SCAN_ESC;\r
+ CustomKey.UnicodeChar = CHAR_NULL;\r
+ } else {\r
+ //\r
+ // Map Esc to Boot Manager Menu\r
+ //\r
+ CustomKey.ScanCode = SCAN_F2;\r
+ CustomKey.UnicodeChar = CHAR_NULL;\r
+ }\r
+\r
EfiBootManagerGetBootManagerMenu (&BootOption);\r
- EfiBootManagerAddKeyOptionVariable (NULL, (UINT16)BootOption.OptionNumber, 0, &F2, NULL);\r
+ EfiBootManagerAddKeyOptionVariable (NULL, (UINT16)BootOption.OptionNumber, 0, &CustomKey, NULL);\r
\r
//\r
// Also add Down key to Boot Manager Menu since some serial terminals don't support F2 key.\r
//\r
PlatformRegisterFvBootOption (PcdGetPtr (PcdShellFile), L"UEFI Shell", LOAD_OPTION_ACTIVE);\r
\r
- Print (\r
- L"\n"\r
- L"F2 or Down to enter Boot Manager Menu.\n"\r
- L"ENTER to boot directly.\n"\r
- L"\n"\r
- );\r
+ if (FixedPcdGetBool (PcdBootManagerEscape)) {\r
+ Print (\r
+ L"\n"\r
+ L"Esc or Down to enter Boot Manager Menu.\n"\r
+ L"ENTER to boot directly.\n"\r
+ L"\n"\r
+ );\r
+ } else {\r
+ Print (\r
+ L"\n"\r
+ L"F2 or Down to enter Boot Manager Menu.\n"\r
+ L"ENTER to boot directly.\n"\r
+ L"\n"\r
+ );\r
+ }\r
}\r
\r
/**\r