diff options
-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.cpp | 4 |
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 ) { |