summaryrefslogtreecommitdiff
path: root/IntelFrameworkModulePkg/Csm
diff options
context:
space:
mode:
authorRuiyu Ni <ruiyu.ni@intel.com>2018-01-19 15:59:38 +0800
committerRuiyu Ni <ruiyu.ni@intel.com>2018-02-01 14:04:12 +0800
commit821807bcefb9a36e598d71a8004fae5aab2052a0 (patch)
tree8abec47780692bbf5ac159a9a5b7f11e7bb212d9 /IntelFrameworkModulePkg/Csm
parent896ae6fc24e04a2068ae84902b7d3426294f342d (diff)
downloadedk2-821807bcefb9a36e598d71a8004fae5aab2052a0.zip
edk2-821807bcefb9a36e598d71a8004fae5aab2052a0.tar.gz
edk2-821807bcefb9a36e598d71a8004fae5aab2052a0.tar.bz2
IntelFrameworkModule/ThunkKb: 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>
Diffstat (limited to 'IntelFrameworkModulePkg/Csm')
-rw-r--r--IntelFrameworkModulePkg/Csm/BiosThunk/KeyboardDxe/BiosKeyboard.c14
-rw-r--r--IntelFrameworkModulePkg/Csm/BiosThunk/KeyboardDxe/BiosKeyboard.h5
2 files changed, 15 insertions, 4 deletions
diff --git a/IntelFrameworkModulePkg/Csm/BiosThunk/KeyboardDxe/BiosKeyboard.c b/IntelFrameworkModulePkg/Csm/BiosThunk/KeyboardDxe/BiosKeyboard.c
index ec52589..ac8e236 100644
--- a/IntelFrameworkModulePkg/Csm/BiosThunk/KeyboardDxe/BiosKeyboard.c
+++ b/IntelFrameworkModulePkg/Csm/BiosThunk/KeyboardDxe/BiosKeyboard.c
@@ -1,7 +1,7 @@
/** @file
ConsoleOut Routines that speak VGA.
-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
@@ -269,7 +269,9 @@ BiosKeyboardDriverBindingStart (
BiosKeyboardPrivate->StatusRegisterAddress = KEYBOARD_8042_STATUS_REGISTER;
BiosKeyboardPrivate->CommandRegisterAddress = KEYBOARD_8042_COMMAND_REGISTER;
BiosKeyboardPrivate->ExtendedKeyboard = TRUE;
-
+
+ BiosKeyboardPrivate->KeyState.KeyShiftState = 0;
+ BiosKeyboardPrivate->KeyState.KeyToggleState = 0;
BiosKeyboardPrivate->Queue.Front = 0;
BiosKeyboardPrivate->Queue.Rear = 0;
BiosKeyboardPrivate->QueueForNotify.Front = 0;
@@ -978,6 +980,8 @@ KeyboardReadKeyStrokeWorker (
//
Status = CheckQueue (&BiosKeyboardPrivate->Queue);
if (EFI_ERROR (Status)) {
+ ZeroMem (&KeyData->Key, sizeof (KeyData->Key));
+ CopyMem (&KeyData->KeyState, &BiosKeyboardPrivate->KeyState, sizeof (EFI_KEY_STATE));
gBS->RestoreTPL (OldTpl);
return EFI_NOT_READY;
}
@@ -1986,6 +1990,12 @@ BiosKeyboardTimerHandler (
}
Enqueue (&BiosKeyboardPrivate->Queue, &KeyData);
+
+ //
+ // Save the current key state
+ //
+ CopyMem (&BiosKeyboardPrivate->KeyState, &KeyData.KeyState, sizeof (EFI_KEY_STATE));
+
//
// Leave critical section and return
//
diff --git a/IntelFrameworkModulePkg/Csm/BiosThunk/KeyboardDxe/BiosKeyboard.h b/IntelFrameworkModulePkg/Csm/BiosThunk/KeyboardDxe/BiosKeyboard.h
index c64ec00..5300eaa 100644
--- a/IntelFrameworkModulePkg/Csm/BiosThunk/KeyboardDxe/BiosKeyboard.h
+++ b/IntelFrameworkModulePkg/Csm/BiosThunk/KeyboardDxe/BiosKeyboard.h
@@ -1,6 +1,6 @@
/** @file
-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
@@ -220,7 +220,8 @@ typedef struct {
UINT16 StatusRegisterAddress;
UINT16 CommandRegisterAddress;
BOOLEAN ExtendedKeyboard;
-
+
+ EFI_KEY_STATE KeyState;
//
// Buffer storing EFI_KEY_DATA
//