]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellDebug1CommandsLib/EditMenuBar.c
ShellPkg: Clean up source files
[mirror_edk2.git] / ShellPkg / Library / UefiShellDebug1CommandsLib / EditMenuBar.c
index b86594bb283e146cd1063a6ee632e34321777416..8490b263cbcd685a690c13ddfc795043723b5e5d 100644 (file)
@@ -47,7 +47,7 @@ MenuBarInit (
   CONST EDITOR_MENU_ITEM  *ItemsWalker;\r
 \r
   for (NumItems = 0, ItemsWalker = Items ; ItemsWalker != NULL && ItemsWalker->Function != NULL ; ItemsWalker++,NumItems++);\r
-  \r
+\r
   MenuItems = AllocateZeroPool((NumItems+1) * sizeof(EDITOR_MENU_ITEM));\r
   if (MenuItems == NULL) {\r
     return EFI_OUT_OF_RESOURCES;\r
@@ -69,7 +69,7 @@ ControlHotKeyInit (
   )\r
 {\r
   ControlBasedMenuFunctions = Items;\r
-  return EFI_SUCCESS; \r
+  return EFI_SUCCESS;\r
 }\r
 /**\r
   Refresh function for the menu bar.\r
@@ -138,7 +138,7 @@ MenuBarRefresh (
 \r
   @param[in] Key                The pressed key.\r
 \r
-  @retval EFI_NOT_FOUND         The key was not a valid function key \r
+  @retval EFI_NOT_FOUND         The key was not a valid function key\r
                                 (an error was sent to the status bar).\r
   @return The return value from the called dispatch function.\r
 **/\r
@@ -167,7 +167,7 @@ MenuBarDispatchFunctionKey (
 \r
   @param[in] KeyData                The pressed key.\r
 \r
-  @retval EFI_NOT_FOUND         The key was not a valid control-based key \r
+  @retval EFI_NOT_FOUND         The key was not a valid control-based key\r
                                 (an error was sent to the status bar).\r
   @return EFI_SUCCESS.\r
 **/\r
@@ -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