isKeyboardEvent

Commons
stable

Type guard that narrows a TRippleEvent to KeyboardEvent by checking constructor.name. Used internally by the ripple system to apply a square ripple on keyboard activation.

API

Signature

Signature TypeScript complète, extraite du fichier util.

typescript

API

Paramètres

Paramètres d'entrée acceptés par cet util.

e
requis
TRippleEvent
The event to classify, typed as TRippleEvent (union of MouseEvent, TouchEvent, KeyboardEvent). The check uses constructor.name for reliable cross-frame detection.

API

Valeur de retour

La valeur retournée par cet util.

true and narrows e to KeyboardEvent when the event originated from the keyboard; false for mouse and touch events.

Usage

Exemples

Extraits de code prêts à coller.

Branching ripple behaviour on keyboard vs pointer

typescript