- \r
- if ((SCAN_CONTROL_Z < Key->UnicodeChar)\r
- ||(NULL == ControlBasedMenuFunctions[Key->UnicodeChar]))\r
+ UINT16 ControlIndex;\r
+\r
+ //\r
+ // Set to invalid value first.\r
+ //\r
+ ControlIndex = MAX_UINT16;\r
+\r
+ if ((KeyData->KeyState.KeyShiftState & EFI_SHIFT_STATE_VALID) == 0) {\r
+ //\r
+ // For those console devices that cannot report the CONTROL 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
+ ((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
+ // make sure only CONTROL is pressed.\r
+ //\r
+ if ((KeyData->Key.UnicodeChar >= L'A') && (KeyData->Key.UnicodeChar <= L'Z')) {\r
+ ControlIndex = KeyData->Key.UnicodeChar - L'A' + 1;\r
+ } else if ((KeyData->Key.UnicodeChar >= L'a') && (KeyData->Key.UnicodeChar <= L'z')) {\r
+ ControlIndex = KeyData->Key.UnicodeChar - L'a' + 1;\r
+ }\r
+ }\r
+ if ((SCAN_CONTROL_Z < ControlIndex)\r
+ ||(NULL == ControlBasedMenuFunctions[ControlIndex]))\r