/* Retrieves the current state of a pointer device. */
EFI_STATUS EFIAPI GetMouseState(IN EFI_SIMPLE_POINTER_PROTOCOL *This, OUT EFI_SIMPLE_POINTER_STATE *MouseState)
/* Retrieves the current state of a pointer device. */
EFI_STATUS EFIAPI GetMouseState(IN EFI_SIMPLE_POINTER_PROTOCOL *This, OUT EFI_SIMPLE_POINTER_STATE *MouseState)
{
  USB_MOUSE_DEV  *MouseDev;
  if (MouseState == NULL) {
    return EFI_INVALID_PARAMETER;
  }
  MouseDev = USB_MOUSE_DEV_FROM_MOUSE_PROTOCOL (This);
  if (!MouseDev->StateChanged) {
    return EFI_NOT_READY;
  }
  CopyMem (
    MouseState,
    &MouseDev->State,
    sizeof (EFI_SIMPLE_POINTER_STATE)
    );
  MouseDev->State.RelativeMovementX = 0;
  MouseDev->State.RelativeMovementY = 0;
  MouseDev->State.RelativeMovementZ = 0;
  MouseDev->StateChanged = FALSE;
  return EFI_SUCCESS;
}