Initial commit
This commit is contained in:
100
application/source/engine/event.c
Normal file
100
application/source/engine/event.c
Normal file
@@ -0,0 +1,100 @@
|
||||
|
||||
#include "vector.h"
|
||||
|
||||
#include "../vector2.h"
|
||||
|
||||
#include "stdbool.h"
|
||||
|
||||
|
||||
/*
|
||||
|
||||
DOM Level 3 defines nine mouse events.
|
||||
|
||||
event
|
||||
|
||||
keyboard
|
||||
|
||||
key : ArrowUp
|
||||
|
||||
keyCode : 123
|
||||
|
||||
shiftKey : false
|
||||
|
||||
ctrlKey : true
|
||||
|
||||
altKey : false
|
||||
|
||||
metaKey : false
|
||||
|
||||
|
||||
screen
|
||||
|
||||
position
|
||||
|
||||
vector2
|
||||
|
||||
size
|
||||
|
||||
vector2
|
||||
|
||||
|
||||
mouse
|
||||
|
||||
position
|
||||
|
||||
vector2
|
||||
|
||||
button:
|
||||
0 Left
|
||||
|
||||
1 middle
|
||||
|
||||
2 right
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
class mouse{
|
||||
|
||||
vector2 position;
|
||||
|
||||
int button;
|
||||
|
||||
vector<char *> * eventTypes = new vector();
|
||||
|
||||
}
|
||||
|
||||
class screen{
|
||||
|
||||
vector2 size;
|
||||
|
||||
vector2 position;
|
||||
|
||||
}
|
||||
|
||||
class keyboard{
|
||||
|
||||
int keyCode;
|
||||
|
||||
bool shiftKey;
|
||||
|
||||
bool ctrlKey;
|
||||
|
||||
bool altKey;
|
||||
|
||||
bool metaKey;
|
||||
|
||||
}
|
||||
|
||||
class event{
|
||||
|
||||
struct mouse * mouse = new mouse();
|
||||
|
||||
struct screen * screen = new screen();
|
||||
|
||||
struct keyboard * keyboard = new keyboard();
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user