12345678910111213141516171819202122232425262728293031 |
- #ifndef KEYS_H
- #define KEYS_H
- #include <array>
- #include "utils/Types.h"
- struct Keys final {
- uint add(int glfwKey);
- bool isDown(uint key) const;
- uint getDownTime(uint key) const;
- void release(int glfwKey);
- void press(int glfwKey);
- void tick();
- private:
- uint searchKey(int glfwKey) const;
- uint getIndex(uint key) const;
- struct Key {
- Key();
- int glfwKey;
- bool down;
- uint downTime;
- };
- std::array<Key, 20> keys;
- };
- #endif
|