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