diff options
Diffstat (limited to 'editor/keyboard.cpp')
-rw-r--r-- | editor/keyboard.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/editor/keyboard.cpp b/editor/keyboard.cpp new file mode 100644 index 00000000..a700d0f4 --- /dev/null +++ b/editor/keyboard.cpp @@ -0,0 +1,38 @@ +#include "app.hpp" + +namespace floormat { + +void app::do_key(KeyEvent::Key k, KeyEvent::Modifiers m, bool pressed, bool repeated) +{ + //using Mods = KeyEvent::Modifiers; + + (void)m; + (void)repeated; + + const key x = fm_begin(switch (k) + { + using enum KeyEvent::Key; + using enum key; + + default: return COUNT; + case W: return camera_up; + case A: return camera_left; + case S: return camera_down; + case D: return camera_right; + case Home: return camera_reset; + case R: return rotate_tile; + case F5: return quicksave; + case F9: return quickload; + case Esc: return quit; + }); + + if (x != key::COUNT) + keys[x] = pressed; +} + +app::~app() +{ + loader_::destroy(); +} + +} // namespace floormat |