diff options
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; +} |