-
Notifications
You must be signed in to change notification settings - Fork 0
Events
Events in Blazr are separated into 3 different types. All these events are derived from the base class Event which is an abstract class and can not be instantiated. The class provides 5 different functions which all the derivative events should implement. This also enables users to create their own events if they so desire. The functions provided are:
virtual EventType getEventType() const = 0;
virtual int getCategoryFlags() const = 0;
inline bool isInCategory(EventCategory category) {
return getCategoryFlags() & category;
}
// Only for debugging
virtual std::string toString() const { return getName(); }
virtual const char *getName() const = 0;The different event types are:
Events of this type are related to the application behavior. Currently implemented:
- WindowResizeEvent
- WindowCloseEvent
- AppTickEvent
- AppUpdateEvent
- AppRenderEvent
Events of this type are used to create events when a keyboard button has been pressed or released. The provided events are:
- KeyPressedEvent
- KeyReleasedEvent
For different key codes, please refer to: Key Codes
Events of this type are used to create events for mouse actions, such as a mouse button being pressed, released, the mouse being moved, as well as scrolling. The events provided are:
- MouseButtonPressedEvent
- MouseButtonReleasedEvent
- MouseMovedEvent
- MouseScrolledEvnt
For different mouse button codes, please refer to: Mouse Codes