From d593fa58e641aa90d7e1f0759299c59d2665cca6 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 31 May 2014 13:41:23 +0300 Subject: Move keyeventtype into separate file. --- src/input/keyinput.h | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'src/input/keyinput.h') diff --git a/src/input/keyinput.h b/src/input/keyinput.h index b7b7a7936..89a3b71d2 100644 --- a/src/input/keyinput.h +++ b/src/input/keyinput.h @@ -64,6 +64,8 @@ #ifndef INPUT_KEYINPUT_H #define INPUT_KEYINPUT_H +#include "events/keyeventtype.h" + #include "input/key.h" #include @@ -75,7 +77,7 @@ class KeyInput final public: KeyInput() : mKey(0), - mType(0), + mType(KeyEventType::PRESSED), #ifdef USE_SDL2 mText(), #endif @@ -85,22 +87,12 @@ class KeyInput final ~KeyInput() { } - /** - * Key input types. This enum corresponds to the enum with event - * types on KeyEvent for easy mapping. - */ - enum - { - PRESSED = 0, - RELEASED - }; - - void setType(unsigned int type) + void setType(KeyEventType::Type type) { mType = type; } - int getType() const + KeyEventType::Type getType() const { return mType; } @@ -146,7 +138,7 @@ class KeyInput final /** * Holds the type of the key input. */ - unsigned int mType; + KeyEventType::Type mType; #ifdef USE_SDL2 std::string mText; -- cgit v1.2.3-60-g2f50