Skip to content
A edited this page Aug 31, 2022 · 6 revisions

AGE::EventType (enum class)

header: "Age/Events/Event.h"

Describes type of an event.

Values:

None, 
WindowClose, WindowResize, WindowFocus, WindowLostFocus, WindowMoved,
KeyPressed, KeyReleased,
MouseButtonPressed, MouseButtonReleased, MouseMoved, MouseScrolled

AGE::EventCategory (enum)

header: "Age/Events/Event.h"

Describes categories of an event Every category is a bit with an offset of x according to the zero-based index of the enum's member.

Values:

None,
EventCategoryApplication,
EventCategoryInput,
EventCategoryKeyboard,
EventCategoryMouse,
EventCategoryMouseButton,

AGE::Event (class)

header: "Age/Events/Event.h"

Abstract event class. In proccess of the extension those macros should be used

Methods

Name Description
EventType GetEventType() const Event type getter.
const char* Name() const Event name getter.
int CategoryFlags() const Event categories bitfield getter
const age_string_t ToString() const Converts an event to the string format. Mostly useful for logging.
bool IsInCategory(EventCategory category) const Return true if there is an overlap between the category provided and event's category bitfield

Variables

Name Description
bool Handled If true, the event is handled and must not be propagated further.

AGE::EventDispatcher (class)

header: "Age/Events/Event.h"

Accepts an event and dispatches it if the event is correctly formed.

Template Methods

template<typename E, typename F>
bool Dispatch(const F& func)

E - event type

F - dispatch function type, is deduced by the compiler. Should return true if the event is handled by the dispatch function and must not be propagated further.

Returns true if it was possible to dispatch the event; false, if the event's type is incorrect and the event cannot be dispatched.

Variables

Name Description
Event& event_ Event to be dispatched.

AGE::KeyEvent (class)

header: "Age/Event/KeyEvent.h"

parent: Event

Key event base class. For base class check Event.

Constructors

Name Description
protected KeyEvent(const KeyCode keycode)

Methods

Name Description
KeyCode GetKeyCode() keycode_ getter

Variables

Name Description
protected KeyCode keycode_ Event's key code.

AGE::KeyPressedEvent (class)

header: "Age/Events/KeyEvent.h"

parent: KeyEvent

Event informing that key was pressed.

Constructors

Name Description
KeyPressedEvent(const KeyCode keyCode, const bool isRepeated)

Variables

Name Description
private bool isRepeated_ true if the key is holded and that generated OS' repeated press event.

AGE::KeyReleasedEvent (class)

header: "Age/Events/KeyEvent.h"

parent: KeyEvent

Event informing that key was released.

AGE::MouseButtonEvent (class)

header: "Age/Events/MouseEvent.h"

parent: Event

Base class for mouse button events.

Constructors

Name Description
protected MouseButtonEvent(MouseCode mouseButtonCode)

Methods

Name Description
MouseCode MouseButton() mouseButtonCode_ getter.

Variables

Name Description
protected MouseCode mouseCode_
MouseCode MouseButton() mouseButtonCode_ getter

AGE::MouseButtonPressedEvent (class)

header: "Age/Events/MouseEvent.h"

parent: MouseButtonEvent

Event informing that mouse button was pressed.

AGE::MouseButtonReleasedEvent (class)

header: "Age/Events/MouseEvent.h"

parent: MouseButtonEvent

Event informing that mouse button was released.

AGE::MouseMovedEvent (class)

header: "Age/Events/MouseEvent.h"

parent: MouseButtonEvent

Event informing that mouse was moved to {x, y} position.

Constructors

Name Description
MouseMovedEvent(float x, float y)

Methods

Name Description
float X() x_ getter.
float Y() y_ getter.

Variables

Name Description
private float x_
private float y_

AGE::MouseScrolledEvent (class)

header: "Age/Events/MouseEvent.h"

parent: Event

Constructors

Name Description
MouseScrolledEvent(const float xOffset, const float yOffset)

Methods

Name Description
float xOffset() xOffset_ getter.
float yOffset() yOffset_ getter.

Variables

Name Description
float xOffset_
float yOffset_

AGE::WindowCloseEvent (class)

header: "Age/Events/WindowEvent.h"

parent: Event

Event informing that window should be closed.

AGE::WindowResizeEvent (class)

header: "Age/Events/WindowEvent.h"

parent: Event

Event informing that window was resized.

Constructors

Name Description
WindowResizeEvent(unsigned int width, unsigned int height)

Variables

Name Description
float width_
float height_

Macros

header: "Age/Events/Event.h"

Name Description
EVENT_CLASS_TYPE(type) Overrides event methods related to the event type (GetEventType(), Name() and StaticType())
EVENT_CLASS_CATEGORY(category) Overrides event methods related to the categories.

Clone this wiki locally