IntelFrameworkModule/Ps2Kb: ReadKeyStrokeEx always return key state
Today's implementation only return key state when there is a 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>
(cherry picked from commit 896ae6fc24
)
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
Routines implements SIMPLE_TEXT_IN protocol's interfaces based on 8042 interfaces
|
||||
provided by Ps2KbdCtrller.c.
|
||||
|
||||
Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 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
|
||||
@ -165,6 +165,10 @@ KeyboardReadKeyStrokeWorker (
|
||||
Status = EFI_DEVICE_ERROR;
|
||||
} else {
|
||||
Status = PopEfikeyBufHead (&ConsoleInDev->EfiKeyQueue, KeyData);
|
||||
if (Status == EFI_NOT_READY) {
|
||||
ZeroMem (&KeyData->Key, sizeof (KeyData->Key));
|
||||
InitializeKeyState (ConsoleInDev, &KeyData->KeyState);
|
||||
}
|
||||
}
|
||||
|
||||
gBS->RestoreTPL (OldTpl);
|
||||
|
Reference in New Issue
Block a user