Skip to content

Event

Base class for all event objects.

This class defines the core interface for all event types. Derived event types extend this interface with additional data specific to their category.

Events are typically dispatched through the Scene hierarchy, where nodes can override event handlers and optionally mark events as handled.

Types

Event::Type enum

Enumerates all event types.

Each event subclass identifies its type through Event::GetType, allowing runtime checks to distinguish between different kinds of events.

ValueDescription
KeyboardEvent triggered by keyboard input.
MouseEvent triggered by mouse input.
SceneEvent related to scene updates or lifecycle.
UndefinedFallback for undefined or uninitialized event types.

Properties

handled bool

Indicates whether the event has been handled. When set to true, this flag prevents the event from propagating further to other nodes in the scene graph. Handlers should set this to true if no other node should respond to the event.

cpp
bool handled {false};

Functions

GetType() Event::Type virtual

Returns the default event type.

Derived classes should override this to return their corresponding event type.

cpp
virtual Type vglx::Event::GetType() const;

Released under the MIT License.