5 ms·
So if I'm in my text editor and decide I want to change the currently playing song, I need to switch windows/contexts, press a hotkey or GUI button, and switch
by reificator 5y ago
So if I'm in my text editor and decide I want to change the currently playing song, I need to switch windows/contexts, press a hotkey or GUI button, and switch back?
The current model where everything running can listen to everything you do is not acceptable, but that doesn't mean there's no usecases that strongly benefit from global hotkeys.
- chrisseaton 5y ago> So if I'm in my text editor and decide I want to change the currently playing song, I need to switch windows/contexts, press a hotkey or GUI button, and switch back? Looks to me like something the DE should manage for you, not the application. But everyone seems to disagree with me!
- TeMPOraL 5y agoBut how do you teach your DE to do new things for you? And what is your DE in the first place? The answer to both these questions is: an application. Think of applications hooking into global shortcuts as plugins for your DE.
- reificator 5y ago> Looks to me like something the DE should manage for you, not the application. > But everyone seems to disagree with me! The original post you responded to was suggesting that your DE, or at least something outside of your application, provide an API to register specific global hotkeys that you can listen for. In response, you said: > Why would you ever let a non-focused application subscribe to any key combinations? So to me when reading this thread, it looks like you're the one disagreeing with this idea. This is the first post of yours I've seen where you suggest this, and the thread begins with you shooting down the entire concept as ridiculous. Unless you're suggesting that the DE comes with a preconfigured set of global hotkeys and cannot be altered or extended, nor handled differently by different applications. In which case yes, I strongly disagree with that. There's a reasonable middleground between a free-for-all and nothing but what the DE already thought of, and that's a well-defined API boundary alongside per-application, per-feature permissions. Bonus points if the DE handles all key-combination assignment in a consistent UI and applications can only register a suggested keycombo, a context for when the hotkey should be activated, and a function to respond to the event.
- chrisseaton 5y ago> Unless you're suggesting that the DE comes with a preconfigured set of global hotkeys and cannot be altered or extended Yes that's what I'm suggesting. Works fine for almost all use-cases like on macOS. I guess it's just not a popular opinion lol!
- eropple 5y agoI've had custom global hotkeys for stuff in MacOS for over a decade.
- chrisseaton 5y agoBut that's not how things like playback controls are implemented - they have non-extensible separate APIs for that. That's the point.
- eropple 5y agoYou've also been given a raft of other functions that depend on them in this thread. I'm not sure what your hangup here actually is.
- zxzax 5y agoIME, most of those functions tend to get implemented in the DE when it turns out they're actually useful, or some other mechanism can be used to activate them. So no reason to get hung up on that particular method to do it either.
- reificator 5y agoI did edit the post you responsed to a few times in the last few minutes, so heads up there. > > Unless you're suggesting that the DE comes with a preconfigured set of global hotkeys and cannot be altered or extended > Yes that's what I'm suggesting. Okay, let's use the example of music playback. If your DE handles music playback controls, how does it tell the music player when to stop and start, or skip to next track? Does it hardcode a list of music players, each of which provides its own bespoke API, and the DE calls into the application? Or does it provide a way for any music player to call into the DE, and listen for those play/pause/skip events? And if it does that, then why are the list of events hardcoded? Why not allow the music player to say "I also play podcasts, and I want to provide a hotkey to speed up/slow down the playback speed, or provide a separate hotkey to skip ahead 30 seconds that's distinct from skipping the entire episode."? Why not allow Discord to provide a push-to-talk hotkey so that people on a group call can actually hear each other without dogs barking and keys clacking and people coughing? --- Look at the VSCode Extension API for instance: * Extensions are at least partially isolated from the main process and each other. I don't know how far this goes or how secure, but for our purposes they could be as isolated as you want. * They can register a command which when activated, performs some action from within the extension. * Those commands show up in the command list at the top of the screen when you hit "Control + Shift + P" (which is itself a command subject to all the same rules) and users can select whichever command they want to run. * Those commands can also be assigned to a hotkey. * Extensions can suggest a default binding for this hotkey, but users can go into the VSCode settings page and assign whatever keycombo they desire. * Users can remove keybindings for commands that have them by default. * Users can assign keybindings to commands that don't have them by default. * All keybind editing is performed through the same UI, which is owned by VSCode and not the extension. * VSCode itself is the thing listening to those key events, and it calls into the extension to activate it. * There is a concept of context for when these keybinds apply, such as when a markdown document is active in the editor. Extensions provide these contexts by default and users can override them as they choose. * Extensions themselves don't even start up until an activation event is met. These can be opening a file of a certain language, running a command, etc... What about this model is objectionable in your mind? Who benefits from the lockdown you propose where no new ideas can be tried until the DE authority deigns to allow it?
- michaelmrose 5y agoProbably because nobody on earth wants what would be the convenient design to dictate how they use something.