From 1f771698b2abd8995017bb54e8ba3ec065a9bba1 Mon Sep 17 00:00:00 2001 From: qhuang8 Date: Thu, 27 Sep 2007 12:00:18 +0000 Subject: 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 --- MdeModulePkg/Bus/Usb/UsbKbDxe/keyboard.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'MdeModulePkg') diff --git a/MdeModulePkg/Bus/Usb/UsbKbDxe/keyboard.c b/MdeModulePkg/Bus/Usb/UsbKbDxe/keyboard.c index 44914afb54..9ad1bcef24 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) { -- cgit v1.2.3