summaryrefslogtreecommitdiff
path: root/src/keyboard.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/keyboard.cpp')
-rw-r--r--src/keyboard.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/keyboard.cpp b/src/keyboard.cpp
new file mode 100644
index 0000000..b3efada
--- /dev/null
+++ b/src/keyboard.cpp
@@ -0,0 +1,29 @@
+#include "keyboard.h"
+
+Keyboard::Keyboard(){
+ nop = new Nop;
+}
+Keyboard::~Keyboard(){
+ delete nop;
+}
+
+Command* Keyboard::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* Keyboard::pressed( SDL_Keycode k, Uint16 mod ){
+ // TODO
+ return nop;
+}
+
+Command* Keyboard::released( SDL_Keycode k, Uint16 mod ){
+ // TODO
+ return nop;
+}