With this change KWin/X11 reuses Wayland's modifier only shortcut
architecture. The XInput2 event filter also listens for
- XI_RawKeyPress
- XI_RawKeyRelease
Those events are also reported if another X11 client grabs keyboard
input. Thus KWin gets all key events, just like on Wayland.
All key events are then sent through the Xkb class which performs the
mapping from key codes to key syms and is able to detect whether the
modifier got pressed/released without another key being pressed.
This change will require a few follow up changes, which are required
also for Wayland:
- ignore if another input device got interacted (e.g. mouse press, touch screen, scroll, etc)
- ignore when screen is locked (see existing comment)
- use the layout from XServer instead of using our own (needed on Wayland in nested setup)
The biggest disadvantage of the change is that it triggers a wake
up of KWin on every key event. But as KWin already listens to all
pointer events that's not a big difference and normally a key event
will wake up the compositor any way.