/* Find Key Descriptor in Key Convertion Table given its USB keycode. */
EFI_KEY_DESCRIPTOR* GetKeyDescriptor(IN USB_KB_DEV *UsbKeyboardDevice, IN UINT8 KeyCode)
/* Find Key Descriptor in Key Convertion Table given its USB keycode. */
EFI_KEY_DESCRIPTOR* GetKeyDescriptor(IN USB_KB_DEV *UsbKeyboardDevice, IN UINT8 KeyCode)
{
  UINT8  Index;
  if ((!USBKBD_VALID_KEYCODE (KeyCode)) || ((KeyCode > 0x65) && (KeyCode < 0xe0)) || (KeyCode > 0xe7)) {
    return NULL;
  }
  if (KeyCode <= 0x65) {
    Index = (UINT8)(KeyCode - 4);
  } else {
    Index = (UINT8)(KeyCode - 0xe0 + NUMBER_OF_VALID_NON_MODIFIER_USB_KEYCODE);
  }
  return &UsbKeyboardDevice->KeyConvertionTable[Index];
}