input: add transparent binds

adds a new flag for binds to be transparent (non-shadowable)
fixes #3058
This commit is contained in:
vaxerski
2023-08-25 12:35:24 +02:00
parent ad085666c1
commit 6a5a5ed11e
3 changed files with 22 additions and 12 deletions

View File

@@ -795,6 +795,7 @@ void CConfigManager::handleBind(const std::string& command, const std::string& v
bool repeat = false;
bool mouse = false;
bool nonConsuming = false;
bool transparent = false;
const auto BINDARGS = command.substr(4);
for (auto& arg : BINDARGS) {
@@ -808,6 +809,8 @@ void CConfigManager::handleBind(const std::string& command, const std::string& v
mouse = true;
} else if (arg == 'n') {
nonConsuming = true;
} else if (arg == 't') {
transparent = true;
} else {
parseError = "bind: invalid flag";
return;
@@ -865,11 +868,12 @@ void CConfigManager::handleBind(const std::string& command, const std::string& v
if (KEY != "") {
if (isNumber(KEY) && std::stoi(KEY) > 9)
g_pKeybindManager->addKeybind(SKeybind{"", std::stoi(KEY), MOD, HANDLER, COMMAND, locked, m_szCurrentSubmap, release, repeat, mouse, nonConsuming});
g_pKeybindManager->addKeybind(SKeybind{"", std::stoi(KEY), MOD, HANDLER, COMMAND, locked, m_szCurrentSubmap, release, repeat, mouse, nonConsuming, transparent});
else if (KEY.find("code:") == 0 && isNumber(KEY.substr(5)))
g_pKeybindManager->addKeybind(SKeybind{"", std::stoi(KEY.substr(5)), MOD, HANDLER, COMMAND, locked, m_szCurrentSubmap, release, repeat, mouse, nonConsuming});
g_pKeybindManager->addKeybind(
SKeybind{"", std::stoi(KEY.substr(5)), MOD, HANDLER, COMMAND, locked, m_szCurrentSubmap, release, repeat, mouse, nonConsuming, transparent});
else
g_pKeybindManager->addKeybind(SKeybind{KEY, -1, MOD, HANDLER, COMMAND, locked, m_szCurrentSubmap, release, repeat, mouse, nonConsuming});
g_pKeybindManager->addKeybind(SKeybind{KEY, -1, MOD, HANDLER, COMMAND, locked, m_szCurrentSubmap, release, repeat, mouse, nonConsuming, transparent});
}
}