summaryrefslogtreecommitdiff
path: root/src/keyboardconfig.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/keyboardconfig.cpp')
-rw-r--r--src/keyboardconfig.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/keyboardconfig.cpp b/src/keyboardconfig.cpp
index 3185a58a..5cce793a 100644
--- a/src/keyboardconfig.cpp
+++ b/src/keyboardconfig.cpp
@@ -28,11 +28,6 @@
#include "gui/setup_keyboard.h"
-void KeyboardConfig::destroy()
-{
-
-}
-
void KeyboardConfig::init()
{
mKey[KEY_MOVE_UP] = KeyFunction("keyMoveUp", SDLK_UP, "Move Up");
@@ -44,7 +39,7 @@ void KeyboardConfig::init()
mKey[KEY_ATTACK] = KeyFunction("keyAttack", SDLK_LCTRL, "Attack");
mKey[KEY_TARGET] = KeyFunction("keyTarget", SDLK_LSHIFT, "Target");
mKey[KEY_TARGET_CLOSEST] =
- KeyFunction("mKeyTargetClosest", SDLK_a, "Target Closest");
+ KeyFunction("keyTargetClosest", SDLK_a, "Target Closest");
mKey[KEY_PICKUP] = KeyFunction("keyPickup", SDLK_z, "Pickup");
mKey[KEY_HIDE_WINDOWS] =
KeyFunction("keyHideWindows", SDLK_h, "Hide Windows");
@@ -60,6 +55,13 @@ void KeyboardConfig::init()
retrieve();
}
+void KeyboardConfig::destroy()
+{
+ store();
+
+ delete [] mActiveKeys;
+}
+
void KeyboardConfig::retrieve()
{
for (int i = 0; i < KEY_TOTAL; i++)
@@ -103,7 +105,7 @@ bool KeyboardConfig::hasConflicts()
void KeyboardConfig::callbackNewKey()
{
- mSetupKey->newKeyCallback((const int) mNewKeyIndex);
+ mSetupKey->newKeyCallback(mNewKeyIndex);
}
int KeyboardConfig::getKeyIndex(const int keyValue) const
@@ -120,7 +122,7 @@ int KeyboardConfig::getKeyIndex(const int keyValue) const
bool KeyboardConfig::isKeyActive(int index)
{
- return mActiveKeys[mKey[index].value];
+ return mActiveKeys[ mKey[index].value];
}
void KeyboardConfig::refreshActiveKeys()