diff options
author | Ekaitz Zarraga <ekaitz@elenq.tech> | 2021-12-24 19:53:16 +0100 |
---|---|---|
committer | Ekaitz Zarraga <ekaitz@elenq.tech> | 2021-12-24 19:53:16 +0100 |
commit | 9a9a0e090190dc7a2dba833d1d4efa8417283edc (patch) | |
tree | 4ba43ee254a1362e8400d4a78f6fcaa5c6f3b12b /src/keyHandler.cpp | |
parent | 4eee72704bd85db58981636109fdb456eb78a3c1 (diff) |
Overall cleaning and restructuring using commands
Diffstat (limited to 'src/keyHandler.cpp')
-rw-r--r-- | src/keyHandler.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/keyHandler.cpp b/src/keyHandler.cpp new file mode 100644 index 0000000..e188992 --- /dev/null +++ b/src/keyHandler.cpp @@ -0,0 +1,29 @@ +#include "keyHandler.h" + +KeyHandler::KeyHandler(){ + nop = new Nop; +} +KeyHandler::~KeyHandler(){ + delete nop; +} + +Command* KeyHandler::handleEvent( SDL_Event e ){ + switch( e.type ){ + case SDL_KEYDOWN: + return pressed( e.key.keysym.sym, e.key.keysym.mod ); + case SDL_KEYUP: + return released( e.key.keysym.sym, e.key.keysym.mod ); + default: + return nop; + } +} + +Command* KeyHandler::pressed( SDL_Keycode k, Uint16 mod ){ + // TODO + return nop; +} + +Command* KeyHandler::released( SDL_Keycode k, Uint16 mod ){ + // TODO + return nop; +} |