-
Notifications
You must be signed in to change notification settings - Fork 0
/
EventMouse.h
59 lines (45 loc) · 1.21 KB
/
EventMouse.h
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
#ifndef __EVENT_MOUSE_H__
#define __EVENT_MOUSE_H__
// game engine includes
#include "Event.h"
#include "Position.h"
namespace df{
// string type
const std::string DF_MOUSE_EVENT = "df::mouse";
// Set of mouse buttons recognized by Dragonfly.
enum EventMouseButton {
UNDEFINED_MOUSE_BUTTON = -1,
LEFT,
RIGHT,
MIDDLE,
};
// Set of mouse actions recognized by Dragonfly.
enum EventMouseAction {
UNDEFINED_MOUSE_ACTION = -1,
CLICKED,
PRESSED,
MOVED,
};
class EventMouse : public Event {
private:
EventMouseAction mouse_action; // Mouse action.
EventMouseButton mouse_button; // Mouse button.
Position mouse_xy; // Mouse (x,y) coordinates.
public:
// default constructor
EventMouse();
// Load mouse event's action.
void setMouseAction(EventMouseAction new_mouse_action);
// Get mouse event's action.
EventMouseAction getMouseAction() const;
// Set mouse event's button.
void setMouseButton(EventMouseButton new_mouse_button);
// Get mouse event's button.
EventMouseButton getMouseButton() const;
// Set mouse event's position.
void setMousePosition(Position new_mouse_xy);
// Get mouse event's y position.
Position getMousePosition() const;
};
}
#endif