diff options
author | Perttu Ahola <celeron55@gmail.com> | 2011-07-22 22:35:20 +0300 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-07-22 22:35:20 +0300 |
commit | 58f612eca17e9f2bc8d296df0aba627d4e2e18e3 (patch) | |
tree | 5dd3e31ff7509b7d71b663b6f05f40976d77d0c0 /src | |
parent | 2452ce67f4e283a72b7845d6bce43d7d26b85fc1 (diff) | |
download | minetest-58f612eca17e9f2bc8d296df0aba627d4e2e18e3.tar.gz minetest-58f612eca17e9f2bc8d296df0aba627d4e2e18e3.tar.bz2 minetest-58f612eca17e9f2bc8d296df0aba627d4e2e18e3.zip |
Changing key settings now doesn't require a game restart
Diffstat (limited to 'src')
-rw-r--r-- | src/guiKeyChangeMenu.cpp | 2 | ||||
-rw-r--r-- | src/keycode.cpp | 1 | ||||
-rw-r--r-- | src/keycode.h | 6 |
3 files changed, 6 insertions, 3 deletions
diff --git a/src/guiKeyChangeMenu.cpp b/src/guiKeyChangeMenu.cpp index 3e594aeca..4a11cf93c 100644 --- a/src/guiKeyChangeMenu.cpp +++ b/src/guiKeyChangeMenu.cpp @@ -338,7 +338,7 @@ bool GUIKeyChangeMenu::acceptInput() g_settings.set("keymap_fastmove", keycode_to_keyname(key_fast)); g_settings.set("keymap_special1", keycode_to_keyname(key_use)); g_settings.set("keymap_print_debug_stacks", keycode_to_keyname(key_dump)); - //clearKeyCache(); Y U NO SCOPE?! + clearKeyCache(); return true; } void GUIKeyChangeMenu::init_keys() diff --git a/src/keycode.cpp b/src/keycode.cpp index f014914d0..d6472d2ea 100644 --- a/src/keycode.cpp +++ b/src/keycode.cpp @@ -233,3 +233,4 @@ void clearKeyCache() { g_key_setting_cache.clear(); } + diff --git a/src/keycode.h b/src/keycode.h index 9c62004d8..300682b12 100644 --- a/src/keycode.h +++ b/src/keycode.h @@ -24,11 +24,13 @@ with this program; if not, write to the Free Software Foundation, Inc., #include <string> irr::EKEY_CODE keyname_to_keycode(const char *name); +std::string keycode_to_keyname(s32 keycode); // Key configuration getter irr::EKEY_CODE getKeySetting(const char *settingname); -std::string keycode_to_keyname(s32 keycode); -void clearCache(); + +// Clear fast lookup cache +void clearKeyCache(); #endif |