/* For a specified non-spacing key, there are a list of physical keys following it. This function traverses the list of physical keys and tries to find the physical key matching the KeyDescriptor. */
EFI_KEY_DESCRIPTOR* FindPhysicalKey(IN USB_NS_KEY *UsbNsKey, IN EFI_KEY_DESCRIPTOR *KeyDescriptor)
/* For a specified non-spacing key, there are a list of physical keys following it. This function traverses the list of physical keys and tries to find the physical key matching the KeyDescriptor. */
EFI_KEY_DESCRIPTOR* FindPhysicalKey(IN USB_NS_KEY *UsbNsKey, IN EFI_KEY_DESCRIPTOR *KeyDescriptor)
{
  UINTN               Index;
  EFI_KEY_DESCRIPTOR  *PhysicalKey;
  PhysicalKey = &UsbNsKey->NsKey[1];
  for (Index = 0; Index < UsbNsKey->KeyCount; Index++) {
    if (KeyDescriptor->Key == PhysicalKey->Key) {
      return PhysicalKey;
    }
    PhysicalKey++;
  }
  return KeyDescriptor;
}