diff options
| author | outfoxxed <outfoxxed@outfoxxed.me> | 2023-06-14 04:08:56 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-14 13:08:56 +0200 |
| commit | f0e4f6622e3e9addc530119b804d2f71395455e7 (patch) | |
| tree | fb26406e4fd956c0573ae4745edc23c8506793af /src/config/ConfigManager.cpp | |
| parent | 9a88c19f1ad2acad3cdfd2c81af6e40f2a0219b1 (diff) | |
Implement pass binds (#2503)
* Implement pass binds
Pass binds run the associated dispatcher but do not prevent windows
from receiving the bind.
* Fix pass binds not working properly with release binds
* Rename `pass` to `nonConsuming`
Diffstat (limited to 'src/config/ConfigManager.cpp')
| -rw-r--r-- | src/config/ConfigManager.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index f41a48d9..d86e5410 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -770,11 +770,12 @@ void CConfigManager::handleBind(const std::string& command, const std::string& v // bind[fl]=SUPER,G,exec,dmenu_run <args> // flags - bool locked = false; - bool release = false; - bool repeat = false; - bool mouse = false; - const auto BINDARGS = command.substr(4); + bool locked = false; + bool release = false; + bool repeat = false; + bool mouse = false; + bool nonConsuming = false; + const auto BINDARGS = command.substr(4); for (auto& arg : BINDARGS) { if (arg == 'l') { @@ -785,6 +786,8 @@ void CConfigManager::handleBind(const std::string& command, const std::string& v repeat = true; } else if (arg == 'm') { mouse = true; + } else if (arg == 'n') { + nonConsuming = true; } else { parseError = "bind: invalid flag"; return; @@ -842,11 +845,11 @@ 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}); + g_pKeybindManager->addKeybind(SKeybind{"", std::stoi(KEY), MOD, HANDLER, COMMAND, locked, m_szCurrentSubmap, release, repeat, mouse, nonConsuming}); 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}); + g_pKeybindManager->addKeybind(SKeybind{"", std::stoi(KEY.substr(5)), MOD, HANDLER, COMMAND, locked, m_szCurrentSubmap, release, repeat, mouse, nonConsuming}); else - g_pKeybindManager->addKeybind(SKeybind{KEY, -1, MOD, HANDLER, COMMAND, locked, m_szCurrentSubmap, release, repeat, mouse}); + g_pKeybindManager->addKeybind(SKeybind{KEY, -1, MOD, HANDLER, COMMAND, locked, m_szCurrentSubmap, release, repeat, mouse, nonConsuming}); } } |
