X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FBus%2FUsb%2FUsbKbDxe%2FKeyBoard.c;h=9af221daaddeaf0a98e0e7b7635953603b95baec;hp=36c80ce4703bcdb14d0ad165f595f8b3d770a45d;hb=aa79b0b3799e95bc21e0df32a135cc5a4d749e4b;hpb=4058e906c15600ee6229335c316cb85fcbd687b3 diff --git a/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c b/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c index 36c80ce470..9af221daad 100644 --- a/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c +++ b/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c @@ -130,40 +130,6 @@ UINT8 KeyboardLayoutTable[USB_KEYCODE_MAX_MAKE + 8][5] = { {EfiKeyA3, 0, 0, EFI_RIGHT_LOGO_MODIFIER, 0}, // 0xe7 }; -/** - Initialize KeyConvertionTable by using default keyboard layout. - - @param UsbKeyboardDevice The USB_KB_DEV instance. - @retval None. - -**/ -VOID -EFIAPI -LoadDefaultKeyboardLayout ( - IN USB_KB_DEV *UsbKeyboardDevice - ) -{ - UINTN Index; - EFI_KEY_DESCRIPTOR *KeyDescriptor; - - // - // Construct KeyConvertionTable by default keyboard layout - // - KeyDescriptor = &UsbKeyboardDevice->KeyConvertionTable[0]; - - for (Index = 0; Index < (USB_KEYCODE_MAX_MAKE + 8); Index++) { - KeyDescriptor->Key = (EFI_KEY) KeyboardLayoutTable[Index][0]; - KeyDescriptor->Unicode = KeyboardLayoutTable[Index][1]; - KeyDescriptor->ShiftedUnicode = KeyboardLayoutTable[Index][2]; - KeyDescriptor->AltGrUnicode = 0; - KeyDescriptor->ShiftedAltGrUnicode = 0; - KeyDescriptor->Modifier = KeyboardLayoutTable[Index][3]; - KeyDescriptor->AffectedAttribute = KeyboardLayoutTable[Index][4]; - - KeyDescriptor++; - } -} - // // EFI_KEY to USB Scan Code convertion table // @@ -330,6 +296,40 @@ KB_MODIFIER KB_Mod[8] = { }; +/** + Initialize KeyConvertionTable by using default keyboard layout. + + @param UsbKeyboardDevice The USB_KB_DEV instance. + @retval None. + +**/ +VOID +EFIAPI +LoadDefaultKeyboardLayout ( + IN USB_KB_DEV *UsbKeyboardDevice + ) +{ + UINTN Index; + EFI_KEY_DESCRIPTOR *KeyDescriptor; + + // + // Construct KeyConvertionTable by default keyboard layout + // + KeyDescriptor = &UsbKeyboardDevice->KeyConvertionTable[0]; + + for (Index = 0; Index < (USB_KEYCODE_MAX_MAKE + 8); Index++) { + KeyDescriptor->Key = (EFI_KEY) KeyboardLayoutTable[Index][0]; + KeyDescriptor->Unicode = KeyboardLayoutTable[Index][1]; + KeyDescriptor->ShiftedUnicode = KeyboardLayoutTable[Index][2]; + KeyDescriptor->AltGrUnicode = 0; + KeyDescriptor->ShiftedAltGrUnicode = 0; + KeyDescriptor->Modifier = KeyboardLayoutTable[Index][3]; + KeyDescriptor->AffectedAttribute = KeyboardLayoutTable[Index][4]; + + KeyDescriptor++; + } +} + /** Uses USB I/O to check whether the device is a USB Keyboard device.