]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.c
ShellPkg/[hex]edit: Fix mouse freeze issue
[mirror_edk2.git] / ShellPkg / Library / UefiShellDebug1CommandsLib / Edit / MainTextEditor.c
index 6832441e8161c07205f59ab9074450e2aa38a500..98e1331ac453267334d1766b9c621d43952192b6 100644 (file)
@@ -1840,7 +1840,6 @@ MainEditorKeyInput (
   EFI_KEY_DATA              KeyData;\r
   EFI_STATUS                Status;\r
   EFI_SIMPLE_POINTER_STATE  MouseState;\r
-  UINTN                     EventIndex;\r
   BOOLEAN                   NoShiftState;\r
 \r
   do {\r
@@ -1876,8 +1875,11 @@ MainEditorKeyInput (
       }\r
     }\r
 \r
-    Status = gBS->WaitForEvent (1, &MainEditor.TextInputEx->WaitForKeyEx, &EventIndex);\r
-    if (!EFI_ERROR (Status) && EventIndex == 0) {\r
+    //\r
+    // CheckEvent() returns Success when non-partial key is pressed.\r
+    //\r
+    Status = gBS->CheckEvent (MainEditor.TextInputEx->WaitForKeyEx);\r
+    if (!EFI_ERROR (Status)) {\r
       Status = MainEditor.TextInputEx->ReadKeyStrokeEx (MainEditor.TextInputEx, &KeyData);\r
       if (!EFI_ERROR (Status)) {\r
         //\r
@@ -1917,11 +1919,11 @@ MainEditorKeyInput (
         }\r
 \r
       }\r
-      //\r
-      // after handling, refresh editor\r
-      //\r
-      MainEditorRefresh ();\r
     }\r
+    //\r
+    // after handling, refresh editor\r
+    //\r
+    MainEditorRefresh ();\r
 \r
   } while (Status != EFI_OUT_OF_RESOURCES && !EditorExit);\r
 \r