-
Notifications
You must be signed in to change notification settings - Fork 1
Events
header: "Age/Events/Event.h"
Describes type of an event.
Values:
None,
WindowClose, WindowResize, WindowFocus, WindowLostFocus, WindowMoved,
KeyPressed, KeyReleased,
MouseButtonPressed, MouseButtonReleased, MouseMoved, MouseScrolled
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,
header: "Age/Events/Event.h"
Abstract event class. In proccess of the extension those macros should be used
| 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 |
| Name | Description |
|---|---|
| bool Handled | If true, the event is handled and must not be propagated further. |
header: "Age/Events/Event.h"
Accepts an event and dispatches it if the event is correctly formed.
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.
| Name | Description |
|---|---|
| Event& event_ | Event to be dispatched. |
header: "Age/Event/KeyEvent.h"
parent: Event
Key event base class. For base class check Event.
| Name | Description | |
|---|---|---|
| protected | KeyEvent(const KeyCode keycode) |
| Name | Description | |
|---|---|---|
| KeyCode GetKeyCode() | keycode_ getter |
| Name | Description | |
|---|---|---|
| protected | KeyCode keycode_ | Event's key code. |
header: "Age/Events/KeyEvent.h"
parent: KeyEvent
Event informing that key was pressed.
| Name | Description |
|---|---|
| KeyPressedEvent(const KeyCode keyCode, const bool isRepeated) |
| Name | Description | |
|---|---|---|
| private | bool isRepeated_ | true if the key is holded and that generated OS' repeated press event. |
header: "Age/Events/KeyEvent.h"
parent: KeyEvent
Event informing that key was released.
header: "Age/Events/MouseEvent.h"
parent: Event
Base class for mouse button events.
| Name | Description | |
|---|---|---|
| protected | MouseButtonEvent(MouseCode mouseButtonCode) |
| Name | Description | |
|---|---|---|
| MouseCode MouseButton() | mouseButtonCode_ getter. |
| Name | Description | |
|---|---|---|
| protected | MouseCode mouseCode_ | |
| MouseCode MouseButton() | mouseButtonCode_ getter |
header: "Age/Events/MouseEvent.h"
parent: MouseButtonEvent
Event informing that mouse button was pressed.
header: "Age/Events/MouseEvent.h"
parent: MouseButtonEvent
Event informing that mouse button was released.
header: "Age/Events/MouseEvent.h"
parent: MouseButtonEvent
Event informing that mouse was moved to {x, y} position.
| Name | Description | |
|---|---|---|
| MouseMovedEvent(float x, float y) |
| Name | Description | |
|---|---|---|
| float X() | x_ getter. | |
| float Y() | y_ getter. |
| Name | Description | |
|---|---|---|
| private | float x_ | |
| private | float y_ |
header: "Age/Events/MouseEvent.h"
parent: Event
| Name | Description | |
|---|---|---|
| MouseScrolledEvent(const float xOffset, const float yOffset) |
| Name | Description | |
|---|---|---|
| float xOffset() | xOffset_ getter. | |
| float yOffset() | yOffset_ getter. |
| Name | Description | |
|---|---|---|
| float xOffset_ | ||
| float yOffset_ |
header: "Age/Events/WindowEvent.h"
parent: Event
Event informing that window should be closed.
header: "Age/Events/WindowEvent.h"
parent: Event
Event informing that window was resized.
| Name | Description | |
|---|---|---|
| WindowResizeEvent(unsigned int width, unsigned int height) |
| Name | Description | |
|---|---|---|
| float width_ | ||
| float height_ |
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. |