--- /dev/null
+#ifndef TACOS_APP_KEYMAP_HPP
+#define TACOS_APP_KEYMAP_HPP
+
+#include <SDL.h>
+
+
+namespace tacos {
+
+class Keymap {
+
+public:
+ enum Action {
+ NONE,
+
+ CAMERA_RIGHT,
+ CAMERA_LEFT,
+ CAMERA_UP,
+ CAMERA_DOWN,
+ CAMERA_BACK,
+ CAMERA_FORWARD,
+ CAMERA_NEARER,
+ CAMERA_FARTHER,
+ CAMERA_PITCH_CCW,
+ CAMERA_PITCH_CW,
+ CAMERA_YAW_CCW,
+ CAMERA_YAW_CW,
+
+ EXIT,
+ };
+
+ static constexpr unsigned int MAX_SCANCODE = 0xFF;
+ static constexpr unsigned int NUM_SCANCODES = MAX_SCANCODE + 1;
+
+public:
+ Keymap();
+
+ void Map(SDL_Scancode scancode, Action);
+ Action Lookup(SDL_Scancode scancode) const;
+ Action Lookup(const SDL_Keysym &s) const { return Lookup(s.scancode); }
+ Action Lookup(const SDL_KeyboardEvent &e) const { return Lookup(e.keysym); }
+
+ void LoadDefault();
+
+private:
+ Action codemap[NUM_SCANCODES];
+
+};
+
+}
+
+#endif