]> git.proxmox.com Git - mirror_edk2.git/commitdiff
EmulatorPkg: Fix issue with ReadKeyStroke returning EFI_SUCCESS when only a modifier...
authorandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 28 Jun 2011 18:11:34 +0000 (18:11 +0000)
committerandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 28 Jun 2011 18:11:34 +0000 (18:11 +0000)
This should only happen for ReadKeyStrokeEx.

signed-off-by: andrewfish

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

EmulatorPkg/EmuGopDxe/GopInput.c

index 571776b194f25dc2e9e8dd1c0e8bbc7ca79f1cce..288a151d6d379b3b27c48420d1d10cf28a1c2bb8 100644 (file)
@@ -189,7 +189,14 @@ EmuGopSimpleTextInReadKeyStroke (
   OldTpl  = gBS->RaiseTPL (TPL_NOTIFY);
 
   Status  = Private->EmuGraphicsWindow->GetKey (Private->EmuGraphicsWindow, &KeyData);
-  CopyMem (Key, &KeyData.Key, sizeof (EFI_INPUT_KEY));
+  if (!EFI_ERROR (Status)) {
+    if ((KeyData.Key.ScanCode == 0) && (KeyData.Key.UnicodeChar == 0)) {
+      // Modifier key was pressed
+      Status = EFI_NOT_READY;
+    } else {
+      CopyMem (Key, &KeyData.Key, sizeof (EFI_INPUT_KEY));
+    }
+  }
 
   //
   // Leave critical section and return