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>
This commit is contained in:
Ruiyu Ni 2018-08-24 11:47:25 +08:00
parent d773459e2f
commit e3c96c391c
1 changed files with 17 additions and 0 deletions

View File

@ -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;
}