]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ShellPkg: Fix SimpleTextInputEx based "CTRL-S" by emptying the buffer to prevent...
authorjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 19 Jan 2012 18:18:12 +0000 (18:18 +0000)
committerjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 19 Jan 2012 18:18:12 +0000 (18:18 +0000)
signed-off-by: jcarsey
reviewed-by: leegrosenbaum

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12944 6f19259b-4bc3-4df7-8a09-765794883524

ShellPkg/Application/Shell/ShellProtocol.c

index 00bbc358fa3c80fd361e1d07aa52af47cce0f186..3371e58b11c59a31adcf4923a8ac5481fe625d4f 100644 (file)
@@ -2,7 +2,7 @@
   Member functions of EFI_SHELL_PROTOCOL and functions for creation,\r
   manipulation, and initialization of EFI_SHELL_PROTOCOL.\r
 \r
-  Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -3336,8 +3336,8 @@ NotificationFunction(
   IN EFI_KEY_DATA *KeyData\r
   )\r
 {\r
-//  ShellPrintEx(-1,-1,L"  <Notify>  ");\r
-   if ((KeyData->Key.UnicodeChar == L'c' || KeyData->Key.UnicodeChar == 3) &&\r
+  EFI_INPUT_KEY Key;\r
+  if ((KeyData->Key.UnicodeChar == L'c' || KeyData->Key.UnicodeChar == 3) &&\r
       (KeyData->KeyState.KeyShiftState == (EFI_SHIFT_STATE_VALID|EFI_LEFT_CONTROL_PRESSED) || KeyData->KeyState.KeyShiftState  == (EFI_SHIFT_STATE_VALID|EFI_RIGHT_CONTROL_PRESSED))\r
       ){ \r
     if (ShellInfoObject.NewEfiShellProtocol->ExecutionBreak == NULL) {\r
@@ -3348,6 +3348,12 @@ NotificationFunction(
               (KeyData->KeyState.KeyShiftState  == (EFI_SHIFT_STATE_VALID|EFI_LEFT_CONTROL_PRESSED) || KeyData->KeyState.KeyShiftState  == (EFI_SHIFT_STATE_VALID|EFI_RIGHT_CONTROL_PRESSED))\r
               ){ \r
     ShellInfoObject.HaltOutput = TRUE;\r
+\r
+    //\r
+    // Make sure that there are no pending keystrokes to pervent the pause.\r
+    //\r
+    gST->ConIn->Reset(gST->ConIn, FALSE);\r
+    while (gST->ConIn->ReadKeyStroke (gST->ConIn, &Key)==EFI_SUCCESS);\r
   }\r
   return (EFI_SUCCESS);\r
 }\r