refactor: Use single case to ignore mods in EI mod mask

This commit is contained in:
Nick Bolton 2025-08-22 16:25:52 +01:00
parent 934ddf1499
commit 34c439b3de

View file

@ -163,11 +163,10 @@ std::uint32_t EiKeyState::convertModMask(xkb_mod_mask_t xkbModMaskIn) const
modMaskOut |= (1 << kKeyModifierBitNumLock); modMaskOut |= (1 << kKeyModifierBitNumLock);
else if (strcmp(XKB_VMOD_NAME_SCROLL, name) == 0) else if (strcmp(XKB_VMOD_NAME_SCROLL, name) == 0)
modMaskOut |= (1 << kKeyModifierBitScrollLock); modMaskOut |= (1 << kKeyModifierBitScrollLock);
else if (strcmp(XKB_VMOD_NAME_META, name) == 0) // possibly the old meta (not the new meta/super/logo key) else if ((strcmp(XKB_VMOD_NAME_META, name) == 0) || // possibly the old meta (not the new meta/super/logo key)
LOG_DEBUG2("modifier mask %s ignored", name); (strcmp(XKB_MOD_NAME_MOD2, name) == 0) || // spare, sometimes mapped to num lock.
else if (strcmp(XKB_MOD_NAME_MOD2, name) == 0) // spare, sometimes mapped to num lock. (strcmp(XKB_MOD_NAME_MOD3, name) == 0) // spare, could be mapped to alt_r, caps lock, scroll lock, etc.
LOG_DEBUG2("modifier mask %s ignored", name); )
else if (strcmp(XKB_MOD_NAME_MOD3, name) == 0) // spare, could be mapped to alt_r, caps lock, scroll lock, etc.
LOG_DEBUG2("modifier mask %s ignored", name); LOG_DEBUG2("modifier mask %s ignored", name);
else else
LOG_WARN("modifier mask %s not accounted for, this is a bug", name); LOG_WARN("modifier mask %s not accounted for, this is a bug", name);