SFML's variant: kind identifies the subtype; payload fields stay intact.
kind
Create an event snapshot, copying its vector fields as well.
data
Readonly
An event-data snapshot whose field types can be distinguished by kind.
The event kind name.
Return the data if the kind matches, or undefined otherwise.
Test the event kind and narrow the event type in TypeScript.
Visit event data synchronously and return the result of visitor.
visitor
Icons made by Lorc, Delapouite & Skoll · game-icons.net · CC BY 3.0
SFML's variant:
kindidentifies the subtype; payload fields stay intact.