/* The SetState() function allows the input device hardware to have state settings adjusted. */
EFI_STATUS EFIAPI EmuGopSimpleTextInExSetState(IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, IN EFI_KEY_TOGGLE_STATE *KeyToggleState)
/* The SetState() function allows the input device hardware to have state settings adjusted. */
EFI_STATUS EFIAPI EmuGopSimpleTextInExSetState(IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, IN EFI_KEY_TOGGLE_STATE *KeyToggleState)
{
  GOP_PRIVATE_DATA  *Private;
  EFI_STATUS        Status;
  EFI_TPL           OldTpl;
  if (KeyToggleState == NULL) {
    return EFI_INVALID_PARAMETER;
  }
  Private = GOP_PRIVATE_DATA_FROM_TEXT_IN_EX_THIS (This);
  if (Private->EmuGraphicsWindow == NULL) {
    return EFI_NOT_READY;
  }
  if (((Private->KeyState.KeyToggleState & EFI_TOGGLE_STATE_VALID) != EFI_TOGGLE_STATE_VALID) ||
      ((*KeyToggleState & EFI_TOGGLE_STATE_VALID) != EFI_TOGGLE_STATE_VALID))
  {
    return EFI_UNSUPPORTED;
  }
  OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
  Status = Private->EmuGraphicsWindow->KeySetState (Private->EmuGraphicsWindow, KeyToggleState);
  gBS->RestoreTPL (OldTpl);
  return Status;
}