Back to API Reference
Struct

KeyboardEvent

sealed

Snapshot of a single keyboard lifecycle event delivered by the native platform layer.

Remarks

Coordinates use Unity screen-space conventions: pixels, origin at bottom-left, Y increases upward. area represents the keyboard rect in those coordinates; for a hidden keyboard area is zero. In an embedded WebGL player the rect remains relative to the canvas and can extend beyond its bounds when the browser keyboard overlaps only part of the page.
public bool IsShowingPhase{ get }

True when the phase represents the keyboard becoming or being visible.

public bool IsHidingPhase{ get }

True when the phase represents the keyboard becoming or being hidden.

public KeyboardEventPhase phase

The lifecycle phase that triggered this event.

public Rect area

Keyboard rect in Unity screen pixels (Y-up, origin bottom-left). For the WillShow / WillChangeFrame phases this is the destination rect (where the keyboard will be after the animation).

public float animationDuration

System animation duration in seconds. Zero when the system did not provide animation metadata (Android <30, WebGL). Apply a sensible default (≈0.25s) when zero.

public KeyboardEasing easing

Closest standard easing matching the system curve. Falls back to EaseInOut when the platform does not expose curve data.

public float animationFraction

Animation progress in the range 0..1. Only meaningful in AnimationProgress events. The value is the system's interpolated fraction — it already incorporates easing.

public bool hasFrameSyncedAnimation

True on platforms that emit per-frame AnimationProgress events (Android API 30+). False on platforms where the keyboard animation must be driven client-side from animationDuration + easing.