diff --git a/gamecore.cpp b/gamecore.cpp index dcfc663..35881ac 100644 --- a/gamecore.cpp +++ b/gamecore.cpp @@ -1,5 +1,6 @@ #include "gamecore.h" #include "mathutils.h" +#include "debug.h" #include int GameCore::MAX_MOVE_DISTANCE = 100; @@ -70,3 +71,9 @@ void GameCore::on_rbutton_down(int mX, int mY) { data.clear_current_vertex(); } + + +void GameCore::on_key_down(SDLKey sym, SDLMod mod, Uint16 unicode) +{ + if (sym == SDLK_q && mod & KMOD_CTRL) is_running = false; +} diff --git a/gamecore.h b/gamecore.h index a69e500..07216e3 100644 --- a/gamecore.h +++ b/gamecore.h @@ -24,6 +24,8 @@ class GameCore : public MainEvent void on_exit(); void on_lbutton_down(int x, int y); void on_rbutton_down(int mX, int mY); + void on_key_down(SDLKey sym, SDLMod mod, Uint16 unicode); + private: bool init();