A possibility to fix this is:
- Implement a plugin infrastructure for the platforms
- Add a Wayland sepcific plugin
2a) Wayland specific plugin built on top of KWayland using a KWayland::Client::Seat and a Keyboard and Pointer on the Seat so that it can track all key presses (on the application) and all pointer events
2b) Use xkbcommon to figure out which modifiers are pressed