src/plan/Keymap.h
raw| 1 | #ifndef HEADER_KEYMAP_H |
| 2 | #define HEADER_KEYMAP_H |
| 3 | |
| 4 | #include "KeyStroke.h" |
| 5 | #include "KeyDesc.h" |
| 6 | |
| 7 | #include "SDL.h" |
| 8 | #include <string> |
| 9 | #include <map> |
| 10 | |
| 11 | /** |
| 12 | * Table of defined keys. |
| 13 | */ |
| 14 | class Keymap { |
| 15 | private: |
| 16 | typedef std::map<KeyStroke,KeyDesc,stroke_less> t_keys; |
| 17 | t_keys m_keys; |
| 18 | public: |
| 19 | void registerKey(const KeyStroke &stroke, const KeyDesc &desc); |
| 20 | int indexPressed(const KeyStroke &stroke) const; |
| 21 | }; |
| 22 | |
| 23 | #endif |