mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-22 21:45:58 +01:00
keybinds: fix keys without keysyms triggering random binds (#4739)
This commit is contained in:
parent
c6b1d82c70
commit
69a4f08dbe
1 changed files with 13 additions and 1 deletions
|
@ -517,7 +517,19 @@ bool CKeybindManager::handleKeybinds(const uint32_t modmask, const SPressedKeyWi
|
||||||
} else {
|
} else {
|
||||||
// oMg such performance hit!!11!
|
// oMg such performance hit!!11!
|
||||||
// this little maneouver is gonna cost us 4µs
|
// 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_CASE_INSENSITIVE);
|
||||||
|
|
||||||
|
if (KBKEY == 0) {
|
||||||
|
// Keysym failed to resolve from the key name of the the currently iterated bind.
|
||||||
|
// This happens for names such as `switch:off:Lid Switch` as well as some keys
|
||||||
|
// (such as yen and ro).
|
||||||
|
//
|
||||||
|
// We can't let compare a 0-value with currently pressed key below,
|
||||||
|
// because if this key also have no keysym (i.e. key.keysym == 0) it will incorrectly trigger the
|
||||||
|
// currently iterated bind. That's confirmed to be happening with yen and ro keys.
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
const auto KBKEYUPPER = xkb_keysym_to_upper(KBKEY);
|
const auto KBKEYUPPER = xkb_keysym_to_upper(KBKEY);
|
||||||
|
|
||||||
if (key.keysym != KBKEY && key.keysym != KBKEYUPPER)
|
if (key.keysym != KBKEY && key.keysym != KBKEYUPPER)
|
||||||
|
|
Loading…
Reference in a new issue