From 1667180ac3554cdeaf00ac2cd0f3ad37e64bce30 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Tue, 12 Apr 2022 15:20:30 +0200 Subject: [PATCH] fix bitwise operation order in IGNOREDMOD --- src/KeybindManager.cpp | 2 +- src/events/events.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/KeybindManager.cpp b/src/KeybindManager.cpp index b30e336..3b0a668 100644 --- a/src/KeybindManager.cpp +++ b/src/KeybindManager.cpp @@ -10,7 +10,7 @@ Keybind* KeybindManager::findKeybindByKey(int mod, xcb_keysym_t keysym) { const auto IGNOREMODMASK = KeybindManager::modToMask(ConfigManager::getString("ignore_mod")); 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; } } diff --git a/src/events/events.cpp b/src/events/events.cpp index f6c9c65..301080b 100644 --- a/src/events/events.cpp +++ b/src/events/events.cpp @@ -780,7 +780,7 @@ void Events::eventKeyPress(xcb_generic_event_t* event) { const auto IGNOREDMOD = KeybindManager::modToMask(ConfigManager::getString("ignore_mod")); 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()); return; // TODO: fix duplicating keybinds