he/him/his, cis, gay, husband, Beagle chew-toy, JavaScript jockey, Rustacean
There’s a portal for Global Shortcuts: https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.GlobalShortcuts.html
KDE and Hyprland already implement it, and COSMIC seems likely to
On the app side, if we can get the major toolkits to adopt it, then hopefully that covers most actively-maintained apps (but it’s unlikely to cover legacy apps): https://github.com/electron/electron/issues/38288
I’m not an expert, but my understanding of the Global Shortcuts portal is that it’s very much designed for the push-to-talk use case where an app is not focused but still receives button events for exactly the keys its interested in and no other keys: I think this would cause problems if an app requested every key (e.g. if the request was approved then no keys would work in every other app)
It’ll be interesting to see how the remaining compatibility/accessibility issues are tackled, either in portals or in wayland protocols