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"));
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;
}
}

View file

@ -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