From a0c049151248395ebefb979aa629009bfd404ac4 Mon Sep 17 00:00:00 2001 From: Quentin Bazin Date: Fri, 17 Jul 2020 21:31:11 +0200 Subject: [PATCH] [KeyboardHandler] Lua-defined keys can now be remapped on first run. --- source/client/core/KeyboardHandler.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/client/core/KeyboardHandler.cpp b/source/client/core/KeyboardHandler.cpp index e160dc7d..36d4fcfd 100644 --- a/source/client/core/KeyboardHandler.cpp +++ b/source/client/core/KeyboardHandler.cpp @@ -117,6 +117,11 @@ void KeyboardHandler::addKey(gk::GameKey id, const std::string &name, SDL_Keycod it.first->second.setKeycode(defaultKey); m_keysID.emplace(it.first->second.stringID(), id); + + if (key) { + key->setKeycode(it.first->second.keycode()); + it.first->second.setParent(key); + } } else { Key &keyitem = m_keys.at(keyit->second);