1 #ifndef BLANK_UI_KEYMAP_HPP_
2 #define BLANK_UI_KEYMAP_HPP_
50 static constexpr unsigned int MAX_SCANCODE = 0xFF;
51 static constexpr unsigned int NUM_SCANCODES = MAX_SCANCODE + 1;
56 void Map(SDL_Scancode scancode, Action);
57 Action Lookup(SDL_Scancode scancode) const;
58 Action Lookup(const SDL_Keysym &s) const { return Lookup(s.scancode); }
59 Action Lookup(const SDL_KeyboardEvent &e) const { return Lookup(e.keysym); }
63 void Load(std::istream &);
64 void Save(std::ostream &);
66 static const char *ActionToString(Action);
67 static Action StringToAction(const std::string &);
70 Action codemap[NUM_SCANCODES];