summaryrefslogtreecommitdiff
path: root/src
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
parent9a9a0e090190dc7a2dba833d1d4efa8417283edc (diff)
Rename keyHandler to keyboard
Diffstat (limited to 'src')
-rw-r--r--src/keyboard.cpp (renamed from src/keyHandler.cpp)12
-rw-r--r--src/keyboard.h (renamed from src/keyHandler.h)6
-rw-r--r--src/main.cpp4
3 files changed, 11 insertions, 11 deletions
diff --git a/src/keyHandler.cpp b/src/keyboard.cpp
index e188992..b3efada 100644
--- a/src/keyHandler.cpp
+++ b/src/keyboard.cpp
@@ -1,13 +1,13 @@
-#include "keyHandler.h"
+#include "keyboard.h"
-KeyHandler::KeyHandler(){
+Keyboard::Keyboard(){
nop = new Nop;
}
-KeyHandler::~KeyHandler(){
+Keyboard::~Keyboard(){
delete nop;
}
-Command* KeyHandler::handleEvent( SDL_Event e ){
+Command* Keyboard::handleEvent( SDL_Event e ){
switch( e.type ){
case SDL_KEYDOWN:
return pressed( e.key.keysym.sym, e.key.keysym.mod );
@@ -18,12 +18,12 @@ Command* KeyHandler::handleEvent( SDL_Event e ){
}
}
-Command* KeyHandler::pressed( SDL_Keycode k, Uint16 mod ){
+Command* Keyboard::pressed( SDL_Keycode k, Uint16 mod ){
// TODO
return nop;
}
-Command* KeyHandler::released( SDL_Keycode k, Uint16 mod ){
+Command* Keyboard::released( SDL_Keycode k, Uint16 mod ){
// TODO
return nop;
}
diff --git a/src/keyHandler.h b/src/keyboard.h
index 5c2152c..fd4680e 100644
--- a/src/keyHandler.h
+++ b/src/keyboard.h
@@ -3,11 +3,11 @@
#include<SDL2/SDL.h>
#include "command.h"
-class KeyHandler{
+class Keyboard{
public:
- KeyHandler();
- ~KeyHandler();
+ Keyboard();
+ ~Keyboard();
Command* handleEvent( SDL_Event e );
Command* pressed( SDL_Keycode k, Uint16 mod = 0);
Command* released( SDL_Keycode k, Uint16 mod = 0);
diff --git a/src/main.cpp b/src/main.cpp
index d059b75..fb4a6b5 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -5,7 +5,7 @@
#include "renderer.h"
#include "window.h"
#include "timer.h"
-#include "keyHandler.h"
+#include "keyboard.h"
#include <chrono>
#include <thread>
@@ -99,7 +99,7 @@ main( int argc, char* args[] ) {
timer.start();
GameState game;
- KeyHandler keys;
+ Keyboard keys;
while( true )
{