Doesn't linux work like this? Where certain input starts at the top (kernel), and then goes to the first program that "listens" for a certain key/combo?
So you could have a program only listen/capture certain keys?
XWin app can listen to all keystrokes in system. This was fixed in Wayland.
Two different questions. You're talking about whether the app must get the user's approval. The question here (in this part of the thread) is whether the app must subscribe to all events and filter them itself or if it can instead subscribe to a filtered version of events.
I know that an Xapp can listen to everything, but I was thinking that it can listen to only some keys/combos.
How would you write an application that uses global shortcuts in Wayland?
Probably through a series of incompatible and as-yet-unimplemented APIs for each desktop environment and window manager you want to support.
You wouldn't, because Wayland is not ready for consumption by people that use their computer with expectations of full functionality. The obvious things for most people (shortcuts being one of them) do not yet work in it.
"fixed".
Especially given Apple apps seem to be able to register keyboard shortcuts in the system preferences and let you change them...
That works through the menu system, so any app that uses the standard menubar can have shortcuts reassigned. It works well, but it comes with the downside that the shortcuts are not global.
If we're at API design, I'd like an even more abstract one: Let the app register intents with associated title, description, icon and suggestion for a keyboard shortcut and let the OS manage how the intent is invoked.
Carbon hotkeys are how you register for a single keystroke. Event taps give you everything. This sounds more like the latter.