gameui

view src/event.h @ 4:e0916bb20b7f

changed the name to goatkit
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 21 Mar 2014 21:45:37 +0200
parents f1014234dece
children
line source
1 #ifndef EVENT_H_
2 #define EVENT_H_
4 #include "vec.h"
6 namespace goatkit {
8 enum EventType {
9 EV_MOUSE_BUTTON,
10 EV_MOUSE_MOTION,
11 EV_MOUSE_FOCUS,
12 EV_KEY
13 };
15 struct ButtonEvent {
16 Vec2 pos;
17 int button;
18 bool press;
19 };
21 struct MotionEvent {
22 Vec2 pos;
23 };
25 struct FocusEvent {
26 bool enter;
27 };
29 struct KeyEvent {
30 int key;
31 bool press;
32 };
34 struct Event {
35 EventType type;
37 ButtonEvent button;
38 MotionEvent motion;
39 FocusEvent focus;
40 KeyEvent key;
41 };
43 } // namespace goatkit
45 #endif // EVENT_H_