summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2007-09-27 12:00:18 +0000
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2007-09-27 12:00:18 +0000
commit1f771698b2abd8995017bb54e8ba3ec065a9bba1 (patch)
tree6725ad43dd9493225f819b70e250fb04707f36c6
parent5364ee3303db28359b01ca5f6d111de122c31326 (diff)
downloadedk2-1f771698b2abd8995017bb54e8ba3ec065a9bba1.zip
edk2-1f771698b2abd8995017bb54e8ba3ec065a9bba1.tar.gz
edk2-1f771698b2abd8995017bb54e8ba3ec065a9bba1.tar.bz2
translate Ctrl + alpha to control value for simple text input protocol
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3952 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c10
-rw-r--r--MdeModulePkg/Bus/Usb/UsbKbDxe/keyboard.c13
2 files changed, 22 insertions, 1 deletions
diff --git a/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c b/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c
index 4ade1e3..c4f1ee1 100644
--- a/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c
+++ b/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c
@@ -1622,6 +1622,16 @@ Returns:
ConsoleIn->Key.UnicodeChar = ConvertKeyboardScanCodeToEfiKey[Index].UnicodeChar;
}
}
+ //
+ // Translate the CTRL-Alpha characters to their corresponding control value (ctrl-a = 0x0001 through ctrl-Z = 0x001A)
+ //
+ if (ConsoleIn->Ctrled) {
+ if (ConsoleIn->Key.UnicodeChar >= 'a' && ConsoleIn->Key.UnicodeChar <= 'z') {
+ ConsoleIn->Key.UnicodeChar = (UINT16) (ConsoleIn->Key.UnicodeChar - 'a' + 1);
+ } else if (ConsoleIn->Key.UnicodeChar >= 'A' && ConsoleIn->Key.UnicodeChar <= 'Z') {
+ ConsoleIn->Key.UnicodeChar = (UINT16) (ConsoleIn->Key.UnicodeChar - 'A' + 1);
+ }
+ }
break;
}
diff --git a/MdeModulePkg/Bus/Usb/UsbKbDxe/keyboard.c b/MdeModulePkg/Bus/Usb/UsbKbDxe/keyboard.c
index 44914af..9ad1bce 100644
--- a/MdeModulePkg/Bus/Usb/UsbKbDxe/keyboard.c
+++ b/MdeModulePkg/Bus/Usb/UsbKbDxe/keyboard.c
@@ -857,7 +857,18 @@ USBKeyCodeToEFIScanCode (
}
}
-
+ //
+ // Translate the CTRL-Alpha characters to their corresponding control value (ctrl-a = 0x0001 through ctrl-Z = 0x001A)
+ //
+ if (UsbKeyboardDevice->CtrlOn) {
+ if (Key->UnicodeChar >= 'a' && Key->UnicodeChar <= 'z') {
+ Key->UnicodeChar = (UINT16) (Key->UnicodeChar - 'a' + 1);
+ } else if (Key->UnicodeChar >= 'A' && Key->UnicodeChar <= 'Z') {
+ Key->UnicodeChar = (UINT16) (Key->UnicodeChar - 'A' + 1);
+ }
+ }
+
+
if (KeyChar >= 0x59 && KeyChar <= 0x63) {
if (UsbKeyboardDevice->NumLockOn && !UsbKeyboardDevice->ShiftOn) {