fix: handle xkb_keymap_mod_get_mask returning 0
This commit is contained in:
parent
debfd4dc69
commit
c11a1caf59
1 changed files with 4 additions and 2 deletions
|
|
@ -129,8 +129,10 @@ std::uint32_t EiKeyState::convertModMask(xkb_mod_mask_t xkbModMaskIn) const
|
||||||
const xkb_mod_mask_t xkbModMask = (1 << xkbModIdx);
|
const xkb_mod_mask_t xkbModMask = (1 << xkbModIdx);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Skip inactive modifiers.
|
// Skip modifiers that have no XKB mask (not mapped to any real modifier)
|
||||||
if ((xkbModMaskIn & xkbModMask) != xkbModMask)
|
// or are inactive. Without the xkbModMask == 0 check, modifiers with mask 0
|
||||||
|
// incorrectly pass the test (0 & 0 == 0) and get processed as "active".
|
||||||
|
if (xkbModMask == 0 || (xkbModMaskIn & xkbModMask) != xkbModMask)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* added in libxkbcommon 1.8.0 in the same commit so we have all or none */
|
/* added in libxkbcommon 1.8.0 in the same commit so we have all or none */
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue