]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellDebug1CommandsLib/EditMenuBar.c
ShellPkg/[hex]edit: Fix CTRL+<Alpha> doesn't work from hyper terminal
[mirror_edk2.git] / ShellPkg / Library / UefiShellDebug1CommandsLib / EditMenuBar.c
index b86594bb283e146cd1063a6ee632e34321777416..58e90ac5b2eb466e4df321783ab4b9f0864d7cff 100644 (file)
@@ -183,16 +183,18 @@ MenuBarDispatchControlHotKey (
   //\r
   ControlIndex = MAX_UINT16;\r
 \r
-  if ((KeyData->KeyState.KeyShiftState & EFI_SHIFT_STATE_VALID) == 0) {\r
+  if (((KeyData->KeyState.KeyShiftState & EFI_SHIFT_STATE_VALID) == 0) ||\r
+      (KeyData->KeyState.KeyShiftState == EFI_SHIFT_STATE_VALID)) {\r
     //\r
-    // For those console devices that cannot report the CONTROL state,\r
+    // For consoles that don't support/report shift state,\r
     // Ctrl+A is translated to 1 (UnicodeChar).\r
     //\r
     ControlIndex = KeyData->Key.UnicodeChar;\r
-  } else if (((KeyData->KeyState.KeyShiftState & (EFI_RIGHT_CONTROL_PRESSED | EFI_LEFT_CONTROL_PRESSED)) != 0) &&\r
+  } else if (((KeyData->KeyState.KeyShiftState & EFI_SHIFT_STATE_VALID) != 0) &&\r
+             ((KeyData->KeyState.KeyShiftState & (EFI_RIGHT_CONTROL_PRESSED | EFI_LEFT_CONTROL_PRESSED)) != 0) &&\r
              ((KeyData->KeyState.KeyShiftState & ~(EFI_SHIFT_STATE_VALID | EFI_RIGHT_CONTROL_PRESSED | EFI_LEFT_CONTROL_PRESSED)) == 0)) {\r
     //\r
-    // For those console devices that can report the CONTROL state,\r
+    // For consoles that supports/reports shift state,\r
     // make sure only CONTROL is pressed.\r
     //\r
     if ((KeyData->Key.UnicodeChar >= L'A') && (KeyData->Key.UnicodeChar <= L'Z')) {\r