summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-12-01 21:06:41 +0300
committerAndrei Karas <akaras@inbox.ru>2014-12-01 21:06:41 +0300
commit96805601e06e6ed6f7b5aaffc3bbb22dd9e8d58a (patch)
treeab92d423103236204864a8495c2c9e7b9564aac0
parentb205c5b9e6614a2821f2a44dc104306a27ade7ba (diff)
downloadmanaverse-96805601e06e6ed6f7b5aaffc3bbb22dd9e8d58a.tar.gz
manaverse-96805601e06e6ed6f7b5aaffc3bbb22dd9e8d58a.tar.bz2
manaverse-96805601e06e6ed6f7b5aaffc3bbb22dd9e8d58a.tar.xz
manaverse-96805601e06e6ed6f7b5aaffc3bbb22dd9e8d58a.zip
Unassign direction change keys.
-rw-r--r--src/configmanager.cpp22
-rw-r--r--src/defaults.cpp2
-rw-r--r--src/input/inputactionmap.h8
3 files changed, 26 insertions, 6 deletions
diff --git a/src/configmanager.cpp b/src/configmanager.cpp
index 44bf58a88..b90ac3180 100644
--- a/src/configmanager.cpp
+++ b/src/configmanager.cpp
@@ -29,6 +29,8 @@
#include "being/beingspeech.h"
+#include "input/inputmanager.h"
+
#include "utils/files.h"
#include "utils/gettext.h"
#include "utils/mkdir.h"
@@ -270,6 +272,10 @@ void ConfigManager::storeSafeParameters()
}
#endif
+#define unassignKey(key, value) \
+ if (config.getStringValue(prefix + key) == value) \
+ config.setValue(key, "-1");
+
void ConfigManager::checkConfigVersion()
{
const int version = config.getIntValue("cfgver");
@@ -322,5 +328,19 @@ void ConfigManager::checkConfigVersion()
if (version < 10)
config.setValue("enableLazyScrolling", false);
- config.setValue("cfgver", 10);
+ if (version < 11)
+ {
+#ifdef USE_SDL2
+ const std::string prefix = std::string("sdl2");
+#else
+ const std::string prefix = std::string();
+#endif
+ unassignKey("keyDirectUp", "k108");
+ unassignKey("keyDirectDown", "k59");
+ unassignKey("keyDirectLeft", "k107");
+ unassignKey("keyDirectRight", "k39");
+ }
+ config.setValue("cfgver", 11);
}
+
+#undef unassignKey
diff --git a/src/defaults.cpp b/src/defaults.cpp
index 81b1abff1..e11e6b897 100644
--- a/src/defaults.cpp
+++ b/src/defaults.cpp
@@ -352,7 +352,7 @@ DefaultsData* getConfigDefaults()
AddDEF("uselonglivesprites", false);
AddDEF("uselonglivesounds", true);
AddDEF("screenDensity", 0);
- AddDEF("cfgver", 10);
+ AddDEF("cfgver", 11);
AddDEF("enableDebugLog", false);
AddDEF("doubleClick", true);
AddDEF("useDiagonalSpeed", true);
diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h
index 34171954c..460f11048 100644
--- a/src/input/inputactionmap.h
+++ b/src/input/inputactionmap.h
@@ -2122,7 +2122,7 @@ static const InputActionData inputActionData[InputAction::TOTAL] = {
"",
false},
{"keyDirectUp",
- InputType::KEYBOARD, SDLK_l,
+ InputType::UNKNOWN, InputAction::NO_VALUE,
InputType::UNKNOWN, InputAction::NO_VALUE,
Input::GRP_DEFAULT,
&Actions::directUp,
@@ -2131,7 +2131,7 @@ static const InputActionData inputActionData[InputAction::TOTAL] = {
"directup|turnup",
false},
{"keyDirectDown",
- InputType::KEYBOARD, SDLK_SEMICOLON,
+ InputType::UNKNOWN, InputAction::NO_VALUE,
InputType::UNKNOWN, InputAction::NO_VALUE,
Input::GRP_DEFAULT,
&Actions::directDown,
@@ -2140,7 +2140,7 @@ static const InputActionData inputActionData[InputAction::TOTAL] = {
"directdown|turndown",
false},
{"keyDirectLeft",
- InputType::KEYBOARD, SDLK_k,
+ InputType::UNKNOWN, InputAction::NO_VALUE,
InputType::UNKNOWN, InputAction::NO_VALUE,
Input::GRP_DEFAULT,
&Actions::directLeft,
@@ -2149,7 +2149,7 @@ static const InputActionData inputActionData[InputAction::TOTAL] = {
"directleft|turnleft",
false},
{"keyDirectRight",
- InputType::KEYBOARD, SDLK_QUOTE,
+ InputType::UNKNOWN, InputAction::NO_VALUE,
InputType::UNKNOWN, InputAction::NO_VALUE,
Input::GRP_DEFAULT,
&Actions::directRight,