/* Dequeue the saved key from internal key queue. */
EFI_STATUS ConSplitterTextInExDequeueKey(IN TEXT_IN_SPLITTER_PRIVATE_DATA *Private, OUT EFI_KEY_DATA *KeyData)
/* Dequeue the saved key from internal key queue. */
EFI_STATUS ConSplitterTextInExDequeueKey(IN TEXT_IN_SPLITTER_PRIVATE_DATA *Private, OUT EFI_KEY_DATA *KeyData)
{
  if (Private->CurrentNumberOfKeys == 0) {
    return EFI_NOT_FOUND;
  }
  CopyMem (KeyData, &Private->KeyQueue[0], sizeof (EFI_KEY_DATA));
  Private->CurrentNumberOfKeys--;
  CopyMem (
    &Private->KeyQueue[0],
    &Private->KeyQueue[1],
    Private->CurrentNumberOfKeys * sizeof (EFI_KEY_DATA)
    );
  return EFI_SUCCESS;
}