-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModuleInput.h
More file actions
48 lines (35 loc) · 700 Bytes
/
Copy pathModuleInput.h
File metadata and controls
48 lines (35 loc) · 700 Bytes
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
#pragma once
#include "Module.h"
#include "Globals.h"
#include "SDL/include/SDL.h"
#define MAX_KEYS 300
typedef unsigned __int8 Uint8;
enum KeyState
{
KEY_IDLE = 0,
KEY_DOWN,
KEY_REPEAT,
KEY_UP,
};
class ModuleInput : public Module
{
public:
ModuleInput();
~ModuleInput();
bool Init();
update_status Update();
bool CleanUp();
KeyState GetKey(int id) const
{ return keys[id]; }
//Mouse
int mousePosition_x;
int mousePosition_y;
bool mouseRightPressed = false;
bool mouseMiddlePressed = false;
bool mouseLeftPressed = false;
private:
const Uint8 *keyboard = NULL;
KeyState* keys;
void GetKeysPressed(const Uint8* keyboard);
void MouseKeysPressed(SDL_Event event);
};