static and functional dispatchers

This commit is contained in:
vaxerski
2022-04-21 15:50:52 +02:00
parent ab2c65e535
commit 66b5c5a143
3 changed files with 51 additions and 26 deletions

View File

@@ -203,6 +203,14 @@ void CConfigManager::handleBind(const std::string& command, const std::string& v
const auto COMMAND = valueCopy;
const auto DISPATCHER = g_pKeybindManager->m_mDispatchers.find(HANDLER);
if (DISPATCHER == g_pKeybindManager->m_mDispatchers.end()) {
Debug::log(ERR, "Invalid dispatcher!");
parseError = "Invalid dispatcher, requested \"" + HANDLER + "\" does not exist";
return;
}
if (KEY != "")
g_pKeybindManager->addKeybind(SKeybind{KEY, MOD, HANDLER, COMMAND});
}