keybinds: add bindp and noshortcutsinhibit (#7017)

This commit is contained in:
MightyPlaza 2024-07-24 12:10:36 +00:00 committed by GitHub
parent 99088eaed8
commit 72bce7efd5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 34 additions and 23 deletions

View file

@ -1983,6 +1983,7 @@ std::optional<std::string> CConfigManager::handleBind(const std::string& command
bool ignoreMods = false;
bool multiKey = false;
bool hasDescription = false;
bool dontInhibit = false;
const auto BINDARGS = command.substr(4);
for (auto& arg : BINDARGS) {
@ -2004,6 +2005,8 @@ std::optional<std::string> CConfigManager::handleBind(const std::string& command
multiKey = true;
} else if (arg == 'd') {
hasDescription = true;
} else if (arg == 'p') {
dontInhibit = true;
} else {
return "bind: invalid flag";
}
@ -2072,8 +2075,9 @@ std::optional<std::string> CConfigManager::handleBind(const std::string& command
return "Invalid catchall, catchall keybinds are only allowed in submaps.";
}
g_pKeybindManager->addKeybind(SKeybind{parsedKey.key, KEYSYMS, parsedKey.keycode, parsedKey.catchAll, MOD, MODS, HANDLER, COMMAND, locked, m_szCurrentSubmap, DESCRIPTION,
release, repeat, mouse, nonConsuming, transparent, ignoreMods, multiKey, hasDescription});
g_pKeybindManager->addKeybind(SKeybind{
parsedKey.key, KEYSYMS, parsedKey.keycode, parsedKey.catchAll, MOD, MODS, HANDLER, COMMAND, locked, m_szCurrentSubmap, DESCRIPTION, release,
repeat, mouse, nonConsuming, transparent, ignoreMods, multiKey, hasDescription, dontInhibit});
}
return {};