]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Change the SimpleTextInEx implementation to return CTRL+C when CTRL and C are both...
authorniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 25 Oct 2011 06:11:54 +0000 (06:11 +0000)
committerniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 25 Oct 2011 06:11:54 +0000 (06:11 +0000)
Signed-off-by: niruiyu
Reviewed-by: qianouyang
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12563 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Bus/Usb/UsbKbDxe/EfiKey.c
MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c

index c576b70f46656c1abe614050172ef080a6cc4640..e4491401e8ccc785aa5eaabde60f79978e53eac8 100644 (file)
@@ -692,6 +692,18 @@ USBKeyboardReadKeyStroke (
     if (KeyData.Key.ScanCode == CHAR_NULL && KeyData.Key.UnicodeChar == SCAN_NULL) {\r
       continue;\r
     }\r
+    //\r
+    // Translate the CTRL-Alpha characters to their corresponding control value\r
+    // (ctrl-a = 0x0001 through ctrl-Z = 0x001A)\r
+    //\r
+    if ((KeyData.KeyState.KeyShiftState & (EFI_LEFT_CONTROL_PRESSED | EFI_RIGHT_CONTROL_PRESSED)) != 0) {\r
+      if (KeyData.Key.UnicodeChar >= L'a' && KeyData.Key.UnicodeChar <= L'z') {\r
+        KeyData.Key.UnicodeChar = (CHAR16) (KeyData.Key.UnicodeChar - L'a' + 1);\r
+      } else if (KeyData.Key.UnicodeChar >= L'A' && KeyData.Key.UnicodeChar <= L'Z') {\r
+        KeyData.Key.UnicodeChar = (CHAR16) (KeyData.Key.UnicodeChar - L'A' + 1);\r
+      }\r
+    }\r
+\r
     CopyMem (Key, &KeyData.Key, sizeof (EFI_INPUT_KEY));\r
     return EFI_SUCCESS;\r
   }\r
index 8c67f67561957e807fdd5d339a1d7304e2369eec..09f1b04c814298557d42bef4406a8234003189ee 100644 (file)
@@ -1689,18 +1689,6 @@ UsbKeyCodeToEfiInputKey (
     }\r
   }\r
 \r
-  //\r
-  // Translate the CTRL-Alpha characters to their corresponding control value\r
-  // (ctrl-a = 0x0001 through ctrl-Z = 0x001A)\r
-  //\r
-  if (UsbKeyboardDevice->CtrlOn) {\r
-    if (KeyData->Key.UnicodeChar >= 'a' && KeyData->Key.UnicodeChar <= 'z') {\r
-      KeyData->Key.UnicodeChar = (UINT8) (KeyData->Key.UnicodeChar - 'a' + 1);\r
-    } else if (KeyData->Key.UnicodeChar >= 'A' && KeyData->Key.UnicodeChar <= 'Z') {\r
-      KeyData->Key.UnicodeChar = (UINT8) (KeyData->Key.UnicodeChar - 'A' + 1);\r
-    }\r
-  }\r
-\r
   return EFI_SUCCESS;\r
 }\r
 \r