]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Usb/UsbKbDxe/EfiKey.c
MdeModulePkg/UsbKb: ReadKeyStrokeEx always return key state
[mirror_edk2.git] / MdeModulePkg / Bus / Usb / UsbKbDxe / EfiKey.c
index fb2bf3fd814de47f3d2e719ed5326d9152d140d2..722350f6093ea53c1beb2faa3dee470a92e3ebb4 100644 (file)
@@ -2,7 +2,7 @@
   USB Keyboard Driver that manages USB keyboard and produces Simple Text Input\r
   Protocol and Simple Text Input Ex Protocol.\r
 \r
-Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 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
@@ -607,6 +607,8 @@ USBKeyboardReadKeyStrokeWorker (
   }\r
 \r
   if (IsQueueEmpty (&UsbKeyboardDevice->EfiKeyQueue)) {\r
+    ZeroMem (&KeyData->Key, sizeof (KeyData->Key));\r
+    InitializeKeyState (UsbKeyboardDevice, &KeyData->KeyState);\r
     return EFI_NOT_READY;\r
   }\r
 \r