]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdTextIn.c
IntelFrameworkModule/Ps2Kb: ReadKeyStrokeEx always return key state
[mirror_edk2.git] / IntelFrameworkModulePkg / Bus / Isa / Ps2KeyboardDxe / Ps2KbdTextIn.c
index 76779553cd38a0a762bf4c530fb27c392899089c..401b0e8c20758f0cae5273ad80b0017f40b5943d 100644 (file)
@@ -2,7 +2,7 @@
   Routines implements SIMPLE_TEXT_IN protocol's interfaces based on 8042 interfaces\r
   provided by Ps2KbdCtrller.c.\r
 \r
-Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -165,6 +165,10 @@ KeyboardReadKeyStrokeWorker (
     Status = EFI_DEVICE_ERROR;\r
   } else {\r
     Status = PopEfikeyBufHead (&ConsoleInDev->EfiKeyQueue, KeyData);\r
+    if (Status == EFI_NOT_READY) {\r
+      ZeroMem (&KeyData->Key, sizeof (KeyData->Key));\r
+      InitializeKeyState (ConsoleInDev, &KeyData->KeyState);\r
+    }\r
   }\r
 \r
   gBS->RestoreTPL (OldTpl);\r