summaryrefslogtreecommitdiffstats
path: root/EmulatorPkg
diff options
context:
space:
mode:
authorRuiyu Ni <ruiyu.ni@intel.com>2018-08-24 11:47:25 +0800
committerRuiyu Ni <ruiyu.ni@intel.com>2018-08-31 10:40:11 +0800
commite3c96c391c5e76274a0b4e4d052f5062187f00d3 (patch)
tree9be135ef83092052d088895a24a3d5dfe66749a1 /EmulatorPkg
parentd773459e2f0b039b4630d3f78638cd40560792b4 (diff)
downloadedk2-e3c96c391c5e76274a0b4e4d052f5062187f00d3.tar.gz
edk2-e3c96c391c5e76274a0b4e4d052f5062187f00d3.tar.bz2
edk2-e3c96c391c5e76274a0b4e4d052f5062187f00d3.zip
EmulatorPkg/Win: ReadKeyStrokeEx() always returns correct KeyState
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1118 Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com> Cc: Andrew Fish <afish@apple.com>
Diffstat (limited to 'EmulatorPkg')
-rw-r--r--EmulatorPkg/Win/Host/WinGopInput.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/EmulatorPkg/Win/Host/WinGopInput.c b/EmulatorPkg/Win/Host/WinGopInput.c
index 6c218ab98a..17d35bb52c 100644
--- a/EmulatorPkg/Win/Host/WinGopInput.c
+++ b/EmulatorPkg/Win/Host/WinGopInput.c
@@ -363,6 +363,23 @@ WinNtWndKeySetState (
GRAPHICS_PRIVATE_DATA *Private;
Private = GRAPHICS_PRIVATE_DATA_FROM_THIS (GraphicsIo);
+ Private->ScrollLock = FALSE;
+ Private->NumLock = FALSE;
+ Private->CapsLock = FALSE;
+ Private->IsPartialKeySupport = FALSE;
+
+ if ((*KeyToggleState & EFI_SCROLL_LOCK_ACTIVE) == EFI_SCROLL_LOCK_ACTIVE) {
+ Private->ScrollLock = TRUE;
+ }
+ if ((*KeyToggleState & EFI_NUM_LOCK_ACTIVE) == EFI_NUM_LOCK_ACTIVE) {
+ Private->NumLock = TRUE;
+ }
+ if ((*KeyToggleState & EFI_CAPS_LOCK_ACTIVE) == EFI_CAPS_LOCK_ACTIVE) {
+ Private->CapsLock = TRUE;
+ }
+ if ((*KeyToggleState & EFI_KEY_STATE_EXPOSED) == EFI_KEY_STATE_EXPOSED) {
+ Private->IsPartialKeySupport = TRUE;
+ }
Private->KeyState.KeyToggleState = *KeyToggleState;
return EFI_SUCCESS;
}