Class Event#

Inheritance Relationships#

Derived Types#

Class Documentation#

class Event#

Event base class.

Subclassed by TRAP::Events::ControllerEvent, TRAP::Events::FileSystemChangeEvent, TRAP::Events::FrameBufferResizeEvent, TRAP::Events::KeyEvent, TRAP::Events::KeyLayoutEvent, TRAP::Events::KeyTypeEvent, TRAP::Events::MonitorEvent, TRAP::Events::MouseButtonEvent, TRAP::Events::MouseEnterEvent, TRAP::Events::MouseLeaveEvent, TRAP::Events::MouseMoveEvent, TRAP::Events::MouseScrollEvent, TRAP::Events::ShaderReloadEvent, TRAP::Events::TextureReloadEvent, TRAP::Events::WindowCloseEvent, TRAP::Events::WindowContentScaleEvent, TRAP::Events::WindowDropEvent, TRAP::Events::WindowFocusEvent, TRAP::Events::WindowLostFocusEvent, TRAP::Events::WindowMaximizeEvent, TRAP::Events::WindowMinimizeEvent, TRAP::Events::WindowMoveEvent, TRAP::Events::WindowResizeEvent, TRAP::Events::WindowRestoreEvent

Public Functions

consteval Event(const Event&) noexcept = delete#

Copy constructor.

consteval Event &operator=(const Event&) noexcept = delete#

Copy assignment operator.

virtual constexpr ~Event() = default#

Virtual destructor.

virtual std::string ToString() const = 0#

Get a string representation of the event.

Returns:

String representation.

virtual constexpr EventType GetEventType() const noexcept = 0#

Retrieve the EventType of the event.

Returns:

EventType.

virtual constexpr std::string GetName() const = 0#

Retrieve the name of the event.

Returns:

Name.

virtual constexpr EventCategory GetCategoryFlags() const noexcept = 0#

Retrieve the category flags of the event.

Returns:

Combination of one or more EventCategory’s.

constexpr bool IsInCategory(EventCategory category) const noexcept#

Check if an event is in the specified category.

Parameters:

category – Category to check.

Returns:

True if event is in the category, false otherwise.

Public Members

bool Handled = false#

If set to true then this event won’t be passed on to other event handlers.

Protected Functions

constexpr Event() noexcept = default#

Constructor.

constexpr Event(Event&&) noexcept = default#

Move constructor.

constexpr Event &operator=(Event&&) noexcept = default#

Move assignment operator.