diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.c index 6832441e81..98e1331ac4 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.c @@ -1840,7 +1840,6 @@ MainEditorKeyInput ( EFI_KEY_DATA KeyData; EFI_STATUS Status; EFI_SIMPLE_POINTER_STATE MouseState; - UINTN EventIndex; BOOLEAN NoShiftState; do { @@ -1876,8 +1875,11 @@ MainEditorKeyInput ( } } - Status = gBS->WaitForEvent (1, &MainEditor.TextInputEx->WaitForKeyEx, &EventIndex); - if (!EFI_ERROR (Status) && EventIndex == 0) { + // + // CheckEvent() returns Success when non-partial key is pressed. + // + Status = gBS->CheckEvent (MainEditor.TextInputEx->WaitForKeyEx); + if (!EFI_ERROR (Status)) { Status = MainEditor.TextInputEx->ReadKeyStrokeEx (MainEditor.TextInputEx, &KeyData); if (!EFI_ERROR (Status)) { // @@ -1917,11 +1919,11 @@ MainEditorKeyInput ( } } - // - // after handling, refresh editor - // - MainEditorRefresh (); } + // + // after handling, refresh editor + // + MainEditorRefresh (); } while (Status != EFI_OUT_OF_RESOURCES && !EditorExit); diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.c index a2e52ea39c..1a89d3d72a 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.c @@ -2108,7 +2108,6 @@ HMainEditorKeyInput ( EFI_KEY_DATA KeyData; EFI_STATUS Status; EFI_SIMPLE_POINTER_STATE MouseState; - UINTN EventIndex; BOOLEAN NoShiftState; BOOLEAN LengthChange; UINTN Size; @@ -2268,8 +2267,11 @@ HMainEditorKeyInput ( } } - Status = gBS->WaitForEvent (1, &HMainEditor.TextInputEx->WaitForKeyEx, &EventIndex); - if (!EFI_ERROR (Status) && EventIndex == 0) { + // + // CheckEvent() returns Success when non-partial key is pressed. + // + Status = gBS->CheckEvent (HMainEditor.TextInputEx->WaitForKeyEx); + if (!EFI_ERROR (Status)) { Status = HMainEditor.TextInputEx->ReadKeyStrokeEx (HMainEditor.TextInputEx, &KeyData); if (!EFI_ERROR (Status)) { // @@ -2351,11 +2353,11 @@ HMainEditorKeyInput ( } } } - // - // after handling, refresh editor - // - HMainEditorRefresh (); } + // + // after handling, refresh editor + // + HMainEditorRefresh (); } while (Status != EFI_OUT_OF_RESOURCES && !HEditorExit);