summaryrefslogtreecommitdiff
path: root/src/keyboard.cpp
diff options
context:
space:
mode:
authorEkaitz Zarraga <ekaitz@elenq.tech>2021-12-24 20:16:41 +0100
committerEkaitz Zarraga <ekaitz@elenq.tech>2021-12-24 20:16:41 +0100
commita7f23865ff7ffb57d35505bc0cf67507f1751ff2 (patch)
treed18a57dc6af9552c1cedefa0d3add8b9d8437287 /src/keyboard.cpp
parent9a9a0e090190dc7a2dba833d1d4efa8417283edc (diff)
Rename keyHandler to keyboard
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;
+}