mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-04 14:11:59 -07:00
Add invalid mod warn
This commit is contained in:
@@ -284,6 +284,7 @@ void CConfigManager::handleBind(const std::string& command, const std::string& v
|
||||
auto valueCopy = value;
|
||||
|
||||
const auto MOD = g_pKeybindManager->stringToModMask(valueCopy.substr(0, valueCopy.find_first_of(",")));
|
||||
const auto MODSTR = valueCopy.substr(0, valueCopy.find_first_of(","));
|
||||
valueCopy = valueCopy.substr(valueCopy.find_first_of(",") + 1);
|
||||
|
||||
const auto KEY = valueCopy.substr(0, valueCopy.find_first_of(","));
|
||||
@@ -302,6 +303,12 @@ void CConfigManager::handleBind(const std::string& command, const std::string& v
|
||||
return;
|
||||
}
|
||||
|
||||
if (MOD == 0 && MODSTR != "") {
|
||||
Debug::log(ERR, "Invalid mod!");
|
||||
parseError = "Invalid mod, requested mod \"" + MODSTR + "\" is not a valid mod.";
|
||||
return;
|
||||
}
|
||||
|
||||
if (KEY != "")
|
||||
g_pKeybindManager->addKeybind(SKeybind{KEY, MOD, HANDLER, COMMAND});
|
||||
}
|
||||
|
Reference in New Issue
Block a user