]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdTextIn.c
MdeModulePkg/Ps2Kb: ReadKeyStrokeEx always return key state
[mirror_edk2.git] / MdeModulePkg / Bus / Isa / Ps2KeyboardDxe / Ps2KbdTextIn.c
index 04e3365f9e6d8533b28c4002c19fb86d257e66d0..5986eca5f3149abb9efb7944b37d1d35e9c44b30 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