]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EmbeddedPkg/Application/AndroidFastboot/AndroidFastbootApp.c
EmbeddedPkg/AndroidFastbootApp: only use ENTER or SPACE to exit
[mirror_edk2.git] / EmbeddedPkg / Application / AndroidFastboot / AndroidFastbootApp.c
index c5e8a7e34af2048151eeb826dd24c9225043ff54..c1ed94f92b6fb04a94b9f324be349791cc4034bf 100644 (file)
@@ -426,6 +426,7 @@ FastbootAppEntryPoint (
   EFI_EVENT                       WaitEventArray[2];\r
   UINTN                           EventIndex;\r
   EFI_SIMPLE_TEXT_INPUT_PROTOCOL *TextIn;\r
+  EFI_INPUT_KEY                   Key;\r
 \r
   mDataBuffer = NULL;\r
 \r
@@ -508,12 +509,21 @@ FastbootAppEntryPoint (
 \r
   // Talk to the user\r
   mTextOut->OutputString (mTextOut,\r
-      L"Android Fastboot mode - version " ANDROID_FASTBOOT_VERSION ". Press any key to quit.\r\n");\r
+      L"Android Fastboot mode - version " ANDROID_FASTBOOT_VERSION ". Press RETURN or SPACE key to quit.\r\n");\r
 \r
   // Quit when the user presses any key, or mFinishedEvent is signalled\r
   WaitEventArray[0] = mFinishedEvent;\r
   WaitEventArray[1] = TextIn->WaitForKey;\r
-  gBS->WaitForEvent (2, WaitEventArray, &EventIndex);\r
+  while (1) {\r
+    gBS->WaitForEvent (2, WaitEventArray, &EventIndex);\r
+    Status = TextIn->ReadKeyStroke (gST->ConIn, &Key);\r
+    if (Key.ScanCode == SCAN_NULL) {\r
+      if ((Key.UnicodeChar == CHAR_CARRIAGE_RETURN) ||\r
+          (Key.UnicodeChar == L' ')) {\r
+        break;\r
+      }\r
+    }\r
+  }\r
 \r
   mTransport->Stop ();\r
   if (EFI_ERROR (Status)) {\r