summaryrefslogtreecommitdiff
path: root/src/config/ConfigManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/config/ConfigManager.cpp')
-rw-r--r--src/config/ConfigManager.cpp83
1 files changed, 38 insertions, 45 deletions
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp
index d03ad83e..a3c60d2b 100644
--- a/src/config/ConfigManager.cpp
+++ b/src/config/ConfigManager.cpp
@@ -2539,52 +2539,45 @@ std::optional<std::string> CConfigManager::handleBind(const std::string& command
// bind[fl]=SUPER,G,exec,dmenu_run <args>
// flags
- bool locked = false;
- bool release = false;
- bool repeat = false;
- bool mouse = false;
- bool nonConsuming = false;
- bool transparent = false;
- bool ignoreMods = false;
- bool multiKey = false;
- bool longPress = false;
- bool hasDescription = false;
- bool dontInhibit = false;
- bool click = false;
- bool drag = false;
- const auto BINDARGS = command.substr(4);
+ bool locked = false;
+ bool release = false;
+ bool repeat = false;
+ bool mouse = false;
+ bool nonConsuming = false;
+ bool transparent = false;
+ bool ignoreMods = false;
+ bool multiKey = false;
+ bool longPress = false;
+ bool hasDescription = false;
+ bool dontInhibit = false;
+ bool click = false;
+ bool drag = false;
+ bool submapUniversal = false;
+ const auto BINDARGS = command.substr(4);
for (auto const& arg : BINDARGS) {
- if (arg == 'l') {
- locked = true;
- } else if (arg == 'r') {
- release = true;
- } else if (arg == 'e') {
- repeat = true;
- } else if (arg == 'm') {
- mouse = true;
- } else if (arg == 'n') {
- nonConsuming = true;
- } else if (arg == 't') {
- transparent = true;
- } else if (arg == 'i') {
- ignoreMods = true;
- } else if (arg == 's') {
- multiKey = true;
- } else if (arg == 'o') {
- longPress = true;
- } else if (arg == 'd') {
- hasDescription = true;
- } else if (arg == 'p') {
- dontInhibit = true;
- } else if (arg == 'c') {
- click = true;
- release = true;
- } else if (arg == 'g') {
- drag = true;
- release = true;
- } else {
- return "bind: invalid flag";
+ switch (arg) {
+ case 'l': locked = true; break;
+ case 'r': release = true; break;
+ case 'e': repeat = true; break;
+ case 'm': mouse = true; break;
+ case 'n': nonConsuming = true; break;
+ case 't': transparent = true; break;
+ case 'i': ignoreMods = true; break;
+ case 's': multiKey = true; break;
+ case 'o': longPress = true; break;
+ case 'd': hasDescription = true; break;
+ case 'p': dontInhibit = true; break;
+ case 'c':
+ click = true;
+ release = true;
+ break;
+ case 'g':
+ drag = true;
+ release = true;
+ break;
+ case 'u': submapUniversal = true; break;
+ default: return "bind: invalid flag";
}
}
@@ -2657,7 +2650,7 @@ std::optional<std::string> CConfigManager::handleBind(const std::string& command
g_pKeybindManager->addKeybind(SKeybind{parsedKey.key, KEYSYMS, parsedKey.keycode, parsedKey.catchAll, MOD, MODS, HANDLER,
COMMAND, locked, m_currentSubmap, DESCRIPTION, release, repeat, longPress,
mouse, nonConsuming, transparent, ignoreMods, multiKey, hasDescription, dontInhibit,
- click, drag});
+ click, drag, submapUniversal});
}
return {};