summaryrefslogtreecommitdiff
path: root/src/configmanager.cpp
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 /src/configmanager.cpp
parentb205c5b9e6614a2821f2a44dc104306a27ade7ba (diff)
downloadplus-96805601e06e6ed6f7b5aaffc3bbb22dd9e8d58a.tar.gz
plus-96805601e06e6ed6f7b5aaffc3bbb22dd9e8d58a.tar.bz2
plus-96805601e06e6ed6f7b5aaffc3bbb22dd9e8d58a.tar.xz
plus-96805601e06e6ed6f7b5aaffc3bbb22dd9e8d58a.zip
Unassign direction change keys.
Diffstat (limited to 'src/configmanager.cpp')
-rw-r--r--src/configmanager.cpp22
1 files changed, 21 insertions, 1 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