From ecfd71af17316deefd3cd4eaa305016b6678109b Mon Sep 17 00:00:00 2001 From: jcarsey Date: Thu, 19 Jan 2012 18:18:12 +0000 Subject: [PATCH] ShellPkg: Fix SimpleTextInputEx based "CTRL-S" by emptying the buffer to prevent immediate release of the pause. 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 | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/ShellPkg/Application/Shell/ShellProtocol.c b/ShellPkg/Application/Shell/ShellProtocol.c index 00bbc358fa..3371e58b11 100644 --- a/ShellPkg/Application/Shell/ShellProtocol.c +++ b/ShellPkg/Application/Shell/ShellProtocol.c @@ -2,7 +2,7 @@ Member functions of EFI_SHELL_PROTOCOL and functions for creation, manipulation, and initialization of EFI_SHELL_PROTOCOL. - Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -3336,8 +3336,8 @@ NotificationFunction( IN EFI_KEY_DATA *KeyData ) { -// ShellPrintEx(-1,-1,L" "); - if ((KeyData->Key.UnicodeChar == L'c' || KeyData->Key.UnicodeChar == 3) && + EFI_INPUT_KEY Key; + if ((KeyData->Key.UnicodeChar == L'c' || KeyData->Key.UnicodeChar == 3) && (KeyData->KeyState.KeyShiftState == (EFI_SHIFT_STATE_VALID|EFI_LEFT_CONTROL_PRESSED) || KeyData->KeyState.KeyShiftState == (EFI_SHIFT_STATE_VALID|EFI_RIGHT_CONTROL_PRESSED)) ){ if (ShellInfoObject.NewEfiShellProtocol->ExecutionBreak == NULL) { @@ -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)) ){ ShellInfoObject.HaltOutput = TRUE; + + // + // Make sure that there are no pending keystrokes to pervent the pause. + // + gST->ConIn->Reset(gST->ConIn, FALSE); + while (gST->ConIn->ReadKeyStroke (gST->ConIn, &Key)==EFI_SUCCESS); } return (EFI_SUCCESS); }