-
-
Notifications
You must be signed in to change notification settings - Fork 24
Description
TL;DR Add a way to redirect all input events to the config for processing, instead of only bound inputs.
My main motivation is for modal behaviors, but it could be used for cli/widget inputs
Rationale
I'm a huge user of modal behavior in software, and not so much a fan of multi key combo.
Anatomy of a Mode
A Mode is usually started by a keystroke/keycombo, and is quite similar to the concept of 'binding layer' already present. Where they differ is in the presence of arbitrary action modifiers (not to be confounded with key modifiers), that can alter the action being performed.
Modes can be thought as an arbitrary string of inputs in the form (this is heavily simplified):
/M?AmT/ or /M?TmA/
M -> enter a given mode (optional if already in that mode)
A/T -> Action & Target
m* -> modifiers. Could be target modifiers, repetition modifiers, etc.
As an example, here are some of the way I usually interact with my WM:
normal mode (act on focus & clients)
/\d*[hjkl]/ -> move focus in direction (hjkl), stepping over \d* clients
/\d*[HLg]/ -> focus tag by direction (HL) stepping over \d* tag, or explicit tag focus when using g
/s\d*[hjkl]/ -> focus Screen in direction (hjkl), stepping over \d+ screen
/m\d+[hlg]/ -> Move client to Tag by direction|globally.
Existing state
Pinnacle's binding layers only partially address this use-case. While its a good start for basic interactions, you can't encode action modifiers (at least not easily, see Workaround section).
Enhancement
I'm don't think the compositor should handle all of that, but instead expose an API to request for all input to be redirected to the config/client, upon which we can build things.
While the modal behavior is my primary concern, the same facilities would also enable rudimentary text inputs for (e.g.) a pseudo cli to start processes without having to open a terminal/menu. (as an example, awesomewm has a ctrl+x binding by default).
This would not replace bindings either. The idea would have binding as they exist now, intercepting inputs with the highest priority, then the active grabber, then the windows.
Workaround
This should already be somewhat achievable through the use of layers. While I haven't tried it yet, you could in theory bind every inputs possible, and process that in a handler for a given layer.
I'm not sure however that you could cleanly have both keybinds and the pseudo grabber at the same time.
The other issue with that workaround is that it adds extra delay