/* * ===================================================================================== * * Filename: Keyboard.hpp * * Description: * * Created: 20/12/2014 00:52:04 * * Author: Quentin Bazin, * * ===================================================================================== */ #ifndef KEYBOARD_HPP_ #define KEYBOARD_HPP_ #include #include "IntTypes.hpp" class Keyboard { public: enum Key { D, Q, S, W, X, Z, E, Left, Right, Up, Down, BackSpace, LeftShift, Space, Return, RightShift }; static bool isKeyPressed(Key key); static bool isKeyPressedOnce(Key key); static bool isKeyPressedWithDelay(Key key, u16 delay); private: static const u8 *getState(); static std::map pressed; static std::map lastTimePressed; static std::map keysCode; }; #endif // KEYBOARD_HPP_