ASW Lib
A.D.S. Games SDL Wrapper Library. A library targeted at Allegro4 users who want to switch to SDL3 and use modern c++.
Loading...
Searching...
No Matches
event.h
Go to the documentation of this file.
1
8
9#ifndef ASW_MODULES_UI_EVENT_H
10#define ASW_MODULES_UI_EVENT_H
11
12#include <string>
13
14#include "../geometry.h"
15#include "../input.h"
16
17namespace asw::ui {
18
21struct UIEvent {
23 enum class Type {
24 KeyDown,
25 KeyUp,
33 Back
34 };
35
38
41
43 bool shift = false;
44
46 int pointer_id = 0;
47
50
53
55 std::string text;
56};
57
58} // namespace asw::ui
59
60#endif // ASW_MODULES_UI_EVENT_H
A 2D vector in space.
Definition geometry.h:21
Common geometry types.
Input module for the ASW library.
Key
Enumeration of keys in the ASW library.
Definition input.h:37
MouseButton
Enumeration of mouse buttons in the ASW library.
Definition input.h:27
Event structure for UI interactions.
Definition event.h:21
Type
Enumeration of UI event types.
Definition event.h:23
asw::Vec2< float > pointer_pos
The pointer position.
Definition event.h:49
asw::input::MouseButton mouse_button
The mouse button associated with the event.
Definition event.h:52
std::string text
The text associated with a TextInput event.
Definition event.h:55
int pointer_id
The pointer identifier.
Definition event.h:46
asw::input::Key key
The key associated with the event.
Definition event.h:40
Type type
The type of the event.
Definition event.h:37
bool shift
Whether the shift key is held.
Definition event.h:43