QuasarEngine
Cross-platform 3D engine and editor
Loading...
Searching...
No Matches
Event.h File Reference

Base class of all events, with their types and categories. More...

#include <quasar/core/Base.h>
#include <cstdint>
#include <string>
#include <type_traits>

Go to the source code of this file.

Classes

class  Quasar::Event
 Base class of all events. More...
class  Quasar::EventOf< Type, Categories >
 Base class of each event class, which gives the event its type and its categories. More...

Namespaces

namespace  Quasar
 Contains all the engine code.

Enumerations

enum class  Quasar::EventType : std::uint8_t {
  Quasar::WindowClose , Quasar::WindowResize , Quasar::WindowFocus , Quasar::WindowMinimize ,
  Quasar::KeyPressed , Quasar::KeyReleased , Quasar::KeyTyped , Quasar::MouseButtonPressed ,
  Quasar::MouseButtonReleased , Quasar::MouseMoved , Quasar::MouseScrolled
}
 Type of an event. Each event class has exactly one type. More...
enum class  Quasar::EventCategory : std::uint8_t {
  Quasar::None = 0 , Quasar::Window = Bit(0) , Quasar::Input = Bit(1) , Quasar::Keyboard = Bit(2) ,
  Quasar::Mouse = Bit(3)
}
 Categories of an event. An event can belong to several categories, combined with the | operator. More...

Functions

constexpr EventCategory Quasar::operator| (EventCategory left, EventCategory right)
 Combines two sets of categories.
constexpr EventCategory Quasar::operator& (EventCategory left, EventCategory right)
 Keeps only the categories found in both sets.
constexpr const char * Quasar::GetEventTypeName (EventType type)
 Returns the name of an event type, for example "KeyPressed".
std::string Quasar::format_as (const Event &event)
 Lets the log macros print an event with {}, using Event::ToString().

Detailed Description

Base class of all events, with their types and categories.

Author
Kurogenshi
Date
2026-10-23