]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/Terminal: ReadKeyStrokeEx always return key state
authorRuiyu Ni <ruiyu.ni@intel.com>
Sat, 24 Feb 2018 07:13:19 +0000 (15:13 +0800)
committerRuiyu Ni <ruiyu.ni@intel.com>
Tue, 6 Mar 2018 04:14:29 +0000 (12:14 +0800)
Because terminal doesn't support shift and toggle key state,
ReadKeyStrokeEx just sets the two states to 0.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c

index 3c1102dac4a1e6db323d15a49f1f67f0db013514..99316376cb062d456fe3a0388bb6efa1f99ca5dc 100644 (file)
@@ -2,7 +2,7 @@
   Implementation for EFI_SIMPLE_TEXT_INPUT_PROTOCOL protocol.\r
 \r
 (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>\r
-Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
 Copyright (C) 2016 Silicon Graphics, Inc. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
@@ -41,13 +41,12 @@ ReadKeyStrokeWorker (
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
-  if (!EfiKeyFiFoRemoveOneKey (TerminalDevice, &KeyData->Key)) {\r
-    return EFI_NOT_READY;\r
-  }\r
-\r
   KeyData->KeyState.KeyShiftState  = 0;\r
   KeyData->KeyState.KeyToggleState = 0;\r
 \r
+  if (!EfiKeyFiFoRemoveOneKey (TerminalDevice, &KeyData->Key)) {\r
+    return EFI_NOT_READY;\r
+  }\r
 \r
   return EFI_SUCCESS;\r
 \r