mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-26 14:05:58 +01:00
Add invalid mod warn
This commit is contained in:
parent
0de058beb1
commit
2a368ef994
1 changed files with 7 additions and 0 deletions
|
@ -284,6 +284,7 @@ void CConfigManager::handleBind(const std::string& command, const std::string& v
|
||||||
auto valueCopy = value;
|
auto valueCopy = value;
|
||||||
|
|
||||||
const auto MOD = g_pKeybindManager->stringToModMask(valueCopy.substr(0, valueCopy.find_first_of(",")));
|
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);
|
valueCopy = valueCopy.substr(valueCopy.find_first_of(",") + 1);
|
||||||
|
|
||||||
const auto KEY = valueCopy.substr(0, valueCopy.find_first_of(","));
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (MOD == 0 && MODSTR != "") {
|
||||||
|
Debug::log(ERR, "Invalid mod!");
|
||||||
|
parseError = "Invalid mod, requested mod \"" + MODSTR + "\" is not a valid mod.";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (KEY != "")
|
if (KEY != "")
|
||||||
g_pKeybindManager->addKeybind(SKeybind{KEY, MOD, HANDLER, COMMAND});
|
g_pKeybindManager->addKeybind(SKeybind{KEY, MOD, HANDLER, COMMAND});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue