diff options
author | chai <chaifix@163.com> | 2019-07-29 09:06:09 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-07-29 09:06:09 +0800 |
commit | ecd7883521cbde02f4f1a6b23a7b3b601c32dbef (patch) | |
tree | 37d94224896ea6a27777f67d31ec8d71cbfc91f9 /source/modules/asura-core/input/keyboard_state.h | |
parent | 7894c2971626f9560b4ec77a1ce5a9a64a4f3810 (diff) |
*misc
Diffstat (limited to 'source/modules/asura-core/input/keyboard_state.h')
-rw-r--r-- | source/modules/asura-core/input/keyboard_state.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/source/modules/asura-core/input/keyboard_state.h b/source/modules/asura-core/input/keyboard_state.h new file mode 100644 index 0000000..f6aa5ea --- /dev/null +++ b/source/modules/asura-core/input/keyboard_state.h @@ -0,0 +1,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
\ No newline at end of file |