]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.c
ShellPkg/[hex]edit: Fix mouse freeze issue
[mirror_edk2.git] / ShellPkg / Library / UefiShellDebug1CommandsLib / HexEdit / MainHexEditor.c
index a2e52ea39c10a5ecc9190be1d5ae41c5a896f338..1a89d3d72a95525ed30d5ba58ab5919ff5b6a39d 100644 (file)
@@ -2108,7 +2108,6 @@ HMainEditorKeyInput (
   EFI_KEY_DATA              KeyData;\r
   EFI_STATUS                Status;\r
   EFI_SIMPLE_POINTER_STATE  MouseState;\r
-  UINTN                     EventIndex;\r
   BOOLEAN                   NoShiftState;\r
   BOOLEAN                   LengthChange;\r
   UINTN                     Size;\r
@@ -2268,8 +2267,11 @@ HMainEditorKeyInput (
       }\r
     }\r
 \r
-    Status = gBS->WaitForEvent (1, &HMainEditor.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 (HMainEditor.TextInputEx->WaitForKeyEx);\r
+    if (!EFI_ERROR (Status)) {\r
       Status = HMainEditor.TextInputEx->ReadKeyStrokeEx (HMainEditor.TextInputEx, &KeyData);\r
       if (!EFI_ERROR (Status)) {\r
         //\r
@@ -2351,11 +2353,11 @@ HMainEditorKeyInput (
           }\r
         }\r
       }\r
-      //\r
-      // after handling, refresh editor\r
-      //\r
-      HMainEditorRefresh ();\r
     }\r
+    //\r
+    // after handling, refresh editor\r
+    //\r
+    HMainEditorRefresh ();\r
 \r
   } while (Status != EFI_OUT_OF_RESOURCES && !HEditorExit);\r
 \r