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