1 #ifndef BLANK_UI_KEYMAP_HPP_
2 #define BLANK_UI_KEYMAP_HPP_
46 static constexpr unsigned int MAX_SCANCODE = 0xFF;
47 static constexpr unsigned int NUM_SCANCODES = MAX_SCANCODE + 1;
52 void Map(SDL_Scancode scancode, Action);
53 Action Lookup(SDL_Scancode scancode);
54 Action Lookup(const SDL_Keysym &s) { return Lookup(s.scancode); }
55 Action Lookup(const SDL_KeyboardEvent &e) { return Lookup(e.keysym); }
59 void Load(std::istream &);
60 void Save(std::ostream &);
62 static const char *ActionToString(Action);
63 static Action StringToAction(const std::string &);
66 Action codemap[NUM_SCANCODES];