fix bitwise operation order in IGNOREDMOD

This commit is contained in:
vaxerski 2022-04-12 15:20:30 +02:00
parent 3518e3ba8a
commit 1667180ac3
2 changed files with 2 additions and 2 deletions

View file

@ -10,7 +10,7 @@ Keybind* KeybindManager::findKeybindByKey(int mod, xcb_keysym_t keysym) {
const auto IGNOREMODMASK = KeybindManager::modToMask(ConfigManager::getString("ignore_mod")); const auto IGNOREMODMASK = KeybindManager::modToMask(ConfigManager::getString("ignore_mod"));
for(auto& key : KeybindManager::keybinds) { for(auto& key : KeybindManager::keybinds) {
if (keysym == key.getKeysym() && (mod == key.getMod() || mod == key.getMod() | IGNOREMODMASK)) { if (keysym == key.getKeysym() && (mod == key.getMod() || (mod == (key.getMod() | IGNOREMODMASK)))) {
return &key; return &key;
} }
} }

View file

@ -780,7 +780,7 @@ void Events::eventKeyPress(xcb_generic_event_t* event) {
const auto IGNOREDMOD = KeybindManager::modToMask(ConfigManager::getString("ignore_mod")); const auto IGNOREDMOD = KeybindManager::modToMask(ConfigManager::getString("ignore_mod"));
for (auto& keybind : KeybindManager::keybinds) { for (auto& keybind : KeybindManager::keybinds) {
if (keybind.getKeysym() != 0 && keybind.getKeysym() == KEYSYM && (keybind.getMod() == E->state || keybind.getMod() | IGNOREDMOD == E->state)) { if (keybind.getKeysym() != 0 && keybind.getKeysym() == KEYSYM && (keybind.getMod() == E->state || ((keybind.getMod() | IGNOREDMOD) == E->state))) {
keybind.getDispatcher()(keybind.getCommand()); keybind.getDispatcher()(keybind.getCommand());
return; return;
// TODO: fix duplicating keybinds // TODO: fix duplicating keybinds