blob: f6aa5ea85efd25c128c40bb1911199f96153fe51 (
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
|
#ifndef __KEYBOARD_STATE_H__
#define __KEYBOARD_STATE_H__
#include <vector>
#include "button.h"
namespace AsuraEngine
{
namespace Input
{
typedef std::vector<Button> Buttons;
class KeyboardState
{
private:
Buttons buttons;
public:
inline KeyboardState(void)
{
this->buttons.reserve(256);
}
inline const Buttons &GetButtons(void) const { return this->buttons; }
inline void AddButton(int key, bool state) { this->buttons.push_back(Button(key, state)); }
void Reset(bool full)
{
this->buttons.clear();
}
};
}
}
#endif
|