diff options
author | Ikalco <[email protected]> | 2024-05-07 01:20:06 -0500 |
---|---|---|
committer | GitHub <[email protected]> | 2024-05-07 07:20:06 +0100 |
commit | 57e76f91d9a388a41223e5ac0f13863d4b663bcd (patch) | |
tree | 7106e892d18c95c3767b30bbbd7b87ceb678a11e | |
parent | 0c446ec5f4c39599ea97cb703dd3ac7718fb9169 (diff) | |
download | Hyprland-57e76f91d9a388a41223e5ac0f13863d4b663bcd.tar.gz Hyprland-57e76f91d9a388a41223e5ac0f13863d4b663bcd.zip |
keybinds: fix xkb keybind name to keysym comparison (#5917)
-rw-r--r-- | src/managers/KeybindManager.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index 6eadfd99..ce518ea6 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -576,9 +576,10 @@ bool CKeybindManager::handleKeybinds(const uint32_t modmask, const SPressedKeyWi } else { // oMg such performance hit!!11! // this little maneouver is gonna cost us 4µs - const auto KBKEY = xkb_keysym_from_name(k.key.c_str(), XKB_KEYSYM_CASE_INSENSITIVE); + const auto KBKEY = xkb_keysym_from_name(k.key.c_str(), XKB_KEYSYM_NO_FLAGS); + const auto KBKEYLOWER = xkb_keysym_from_name(k.key.c_str(), XKB_KEYSYM_CASE_INSENSITIVE); - if (KBKEY == 0) { + if (KBKEY == 0 && KBKEYLOWER == 0) { // Keysym failed to resolve from the key name of the currently iterated bind. // This happens for names such as `switch:off:Lid Switch` as well as some keys // (such as yen and ro). @@ -589,9 +590,7 @@ bool CKeybindManager::handleKeybinds(const uint32_t modmask, const SPressedKeyWi continue; } - const auto KBKEYUPPER = xkb_keysym_to_upper(KBKEY); - - if (key.keysym != KBKEY && key.keysym != KBKEYUPPER) + if (key.keysym != KBKEY && key.keysym != KBKEYLOWER) continue; } |