A keysym can be assigned to several keycodes, so more proper way to
determine whether given modifier is depressed is to iterate over all
returned keycodes and see if any is pressed.
If we check only the first keycode, then alternative mappings may not
work, e.g. win key mapped to alt, etc.
On the other hand, X11 platform already feeds xkb with key events, so we
could use it to determine the effective state of modifiers on both X11
and Wayland session.
BUG: 407720