]> git.proxmox.com Git - mirror_edk2.git/commitdiff
translate Ctrl + alpha to control value for simple text input protocol
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 27 Sep 2007 12:00:18 +0000 (12:00 +0000)
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 27 Sep 2007 12:00:18 +0000 (12:00 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3952 6f19259b-4bc3-4df7-8a09-765794883524

IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c
MdeModulePkg/Bus/Usb/UsbKbDxe/keyboard.c

index 4ade1e340c693b4ecca735a9c726b3002388000b..c4f1ee1780ee54a4d03896f80e2943b031d84d89 100644 (file)
@@ -1622,6 +1622,16 @@ Returns:
           ConsoleIn->Key.UnicodeChar = ConvertKeyboardScanCodeToEfiKey[Index].UnicodeChar;\r
         }\r
       }\r
+      //\r
+      // Translate the CTRL-Alpha characters to their corresponding control value (ctrl-a = 0x0001 through ctrl-Z = 0x001A)\r
+      //\r
+      if (ConsoleIn->Ctrled) {\r
+        if (ConsoleIn->Key.UnicodeChar >= 'a' && ConsoleIn->Key.UnicodeChar <= 'z') {\r
+          ConsoleIn->Key.UnicodeChar = (UINT16) (ConsoleIn->Key.UnicodeChar - 'a' + 1);\r
+        } else if (ConsoleIn->Key.UnicodeChar >= 'A' && ConsoleIn->Key.UnicodeChar <= 'Z') {\r
+          ConsoleIn->Key.UnicodeChar = (UINT16) (ConsoleIn->Key.UnicodeChar - 'A' + 1);\r
+        }\r
+      }\r
 \r
       break;\r
     }\r
index 44914afb541400a01e6e8fb0b5a2e028ef3a490b..9ad1bcef24899b6b814c223cd0bd902708dc4109 100644 (file)
@@ -857,7 +857,18 @@ USBKeyCodeToEFIScanCode (
 \r
     }\r
   }\r
-\r
+  //\r
+  // Translate the CTRL-Alpha characters to their corresponding control value  (ctrl-a = 0x0001 through ctrl-Z = 0x001A)\r
+  //\r
+  if (UsbKeyboardDevice->CtrlOn) {\r
+    if (Key->UnicodeChar >= 'a' && Key->UnicodeChar <= 'z') {\r
+      Key->UnicodeChar = (UINT16) (Key->UnicodeChar - 'a' + 1);\r
+    } else if (Key->UnicodeChar >= 'A' && Key->UnicodeChar <= 'Z') {\r
+      Key->UnicodeChar = (UINT16) (Key->UnicodeChar - 'A' + 1);\r
+    }\r
+  }\r
+  \r
+  \r
   if (KeyChar >= 0x59 && KeyChar <= 0x63) {\r
 \r
     if (UsbKeyboardDevice->NumLockOn && !UsbKeyboardDevice->ShiftOn) {\r