MdeModulePkg/UsbKb: ReadKeyStrokeEx always return key state

Today's implementation only return key state when there is key.
But when user doesn't press any key, the key state cannot be
returned.

The patch changes the ReadKeyStrokeEx() to always return the
key state even there is no key pressed.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
This commit is contained in:
Ruiyu Ni
2018-01-12 19:29:32 +08:00
parent 20ddbc133f
commit c095341cc4
3 changed files with 77 additions and 48 deletions

View File

@@ -2,7 +2,7 @@
USB Keyboard Driver that manages USB keyboard and produces Simple Text Input
Protocol and Simple Text Input Ex Protocol.
Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -607,6 +607,8 @@ USBKeyboardReadKeyStrokeWorker (
}
if (IsQueueEmpty (&UsbKeyboardDevice->EfiKeyQueue)) {
ZeroMem (&KeyData->Key, sizeof (KeyData->Key));
InitializeKeyState (UsbKeyboardDevice, &KeyData->KeyState);
return EFI_NOT_READY;
}