aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/Event.h
blob: c0de4fc4d2de3d664442c6c497b09b20bc4cb4a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#pragma once
#include <typeindex>
//#include "keyCodes.h"
#include <cstdint>
#include <iostream>
#include <string>
#include <unordered_map>
#include <variant>
using Keycode = uint16_t;
enum class MouseButton {
	NONE = 0,
	LEFT_MOUSE = 1,
	RIGHT_MOUSE = 2,
	MIDDLE_MOUSE = 3,
	X1_MOUSE = 4,
	X2_MOUSE = 5,
	SCROLL_UP = 6,
	SCROLL_DOWN = 7,
};
class Event {
public:
bool handled = false;
};

class KeyPressEvent : public Event {
public:
    int repeat = 0;
    Keycode key = 0;
};

class MouseClickEvent : public Event {
public:
    int mouse_x = 0;
    int mouse_y = 0;
    MouseButton button;
};
class KeyReleaseEvent : public Event {
public:
    Keycode key = 0;
};

class MousePressEvent : public Event {
public:
    int mouse_x = 0;
    int mouse_y = 0;
    MouseButton button;
};
class MouseReleaseEvent : public Event {
public:
    int mouse_x = 0;
    int mouse_y = 0;
    MouseButton button;
};
class MouseMoveEvent : public Event {
public:
    int mouse_x = 0;
    int mouse_y = 0;
};
class CollisionEvent : public Event{
public:
    //Collision collisionData;
};
class TextSubmitEvent : public Event{
public:
    std::string text;
};
class ShutDownEvent : public Event {
public:
};