mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-23 00:05:59 +01:00
binds: add ignoreMods flag
This commit is contained in:
parent
784f8a88fb
commit
a0b675ec9e
3 changed files with 12 additions and 5 deletions
|
@ -832,6 +832,7 @@ void CConfigManager::handleBind(const std::string& command, const std::string& v
|
||||||
bool mouse = false;
|
bool mouse = false;
|
||||||
bool nonConsuming = false;
|
bool nonConsuming = false;
|
||||||
bool transparent = false;
|
bool transparent = false;
|
||||||
|
bool ignoreMods = false;
|
||||||
const auto BINDARGS = command.substr(4);
|
const auto BINDARGS = command.substr(4);
|
||||||
|
|
||||||
for (auto& arg : BINDARGS) {
|
for (auto& arg : BINDARGS) {
|
||||||
|
@ -847,6 +848,8 @@ void CConfigManager::handleBind(const std::string& command, const std::string& v
|
||||||
nonConsuming = true;
|
nonConsuming = true;
|
||||||
} else if (arg == 't') {
|
} else if (arg == 't') {
|
||||||
transparent = true;
|
transparent = true;
|
||||||
|
} else if (arg == 'i') {
|
||||||
|
ignoreMods = true;
|
||||||
} else {
|
} else {
|
||||||
parseError = "bind: invalid flag";
|
parseError = "bind: invalid flag";
|
||||||
return;
|
return;
|
||||||
|
@ -904,12 +907,13 @@ void CConfigManager::handleBind(const std::string& command, const std::string& v
|
||||||
|
|
||||||
if (KEY != "") {
|
if (KEY != "") {
|
||||||
if (isNumber(KEY) && std::stoi(KEY) > 9)
|
if (isNumber(KEY) && std::stoi(KEY) > 9)
|
||||||
g_pKeybindManager->addKeybind(SKeybind{"", std::stoi(KEY), MOD, HANDLER, COMMAND, locked, m_szCurrentSubmap, release, repeat, mouse, nonConsuming, transparent});
|
g_pKeybindManager->addKeybind(
|
||||||
|
SKeybind{"", std::stoi(KEY), MOD, HANDLER, COMMAND, locked, m_szCurrentSubmap, release, repeat, mouse, nonConsuming, transparent, ignoreMods});
|
||||||
else if (KEY.starts_with("code:") && isNumber(KEY.substr(5)))
|
else if (KEY.starts_with("code:") && isNumber(KEY.substr(5)))
|
||||||
g_pKeybindManager->addKeybind(
|
g_pKeybindManager->addKeybind(
|
||||||
SKeybind{"", std::stoi(KEY.substr(5)), MOD, HANDLER, COMMAND, locked, m_szCurrentSubmap, release, repeat, mouse, nonConsuming, transparent});
|
SKeybind{"", std::stoi(KEY.substr(5)), MOD, HANDLER, COMMAND, locked, m_szCurrentSubmap, release, repeat, mouse, nonConsuming, transparent, ignoreMods});
|
||||||
else
|
else
|
||||||
g_pKeybindManager->addKeybind(SKeybind{KEY, -1, MOD, HANDLER, COMMAND, locked, m_szCurrentSubmap, release, repeat, mouse, nonConsuming, transparent});
|
g_pKeybindManager->addKeybind(SKeybind{KEY, -1, MOD, HANDLER, COMMAND, locked, m_szCurrentSubmap, release, repeat, mouse, nonConsuming, transparent, ignoreMods});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -435,7 +435,8 @@ bool CKeybindManager::handleKeybinds(const uint32_t& modmask, const std::string&
|
||||||
const bool IGNORECONDITIONS =
|
const bool IGNORECONDITIONS =
|
||||||
SPECIALDISPATCHER && !pressed && SPECIALTRIGGERED; // ignore mods. Pass, global dispatchers should be released immediately once the key is released.
|
SPECIALDISPATCHER && !pressed && SPECIALTRIGGERED; // ignore mods. Pass, global dispatchers should be released immediately once the key is released.
|
||||||
|
|
||||||
if (!IGNORECONDITIONS && (modmask != k.modmask || (g_pCompositor->m_sSeat.exclusiveClient && !k.locked) || k.submap != m_szCurrentSelectedSubmap || k.shadowed))
|
if (!IGNORECONDITIONS &&
|
||||||
|
((modmask != k.modmask && !k.ignoreMods) || (g_pCompositor->m_sSeat.exclusiveClient && !k.locked) || k.submap != m_szCurrentSelectedSubmap || k.shadowed))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!key.empty()) {
|
if (!key.empty()) {
|
||||||
|
|
|
@ -23,12 +23,14 @@ struct SKeybind {
|
||||||
bool mouse = false;
|
bool mouse = false;
|
||||||
bool nonConsuming = false;
|
bool nonConsuming = false;
|
||||||
bool transparent = false;
|
bool transparent = false;
|
||||||
|
bool ignoreMods = false;
|
||||||
|
|
||||||
// DO NOT INITIALIZE
|
// DO NOT INITIALIZE
|
||||||
bool shadowed = false;
|
bool shadowed = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum eFocusWindowMode {
|
enum eFocusWindowMode
|
||||||
|
{
|
||||||
MODE_CLASS_REGEX = 0,
|
MODE_CLASS_REGEX = 0,
|
||||||
MODE_TITLE_REGEX,
|
MODE_TITLE_REGEX,
|
||||||
MODE_ADDRESS,
|
MODE_ADDRESS,
|
||||||
|
|
Loading…
Reference in a new issue