feat: add bindm (modifier-only exclusive keybind)#911
Conversation
| config->key_bindings_count++; | ||
| } | ||
|
|
||
| } else if (regex_match("^bindm[lp]*$", key)) { |
There was a problem hiding this comment.
mango/src/config/parse_config.h
Line 2346 in cabafb2
We already have that on the config a little above, i belive it's a good idea to refractor both of this, somewhere to avoid add new modifier, like a y and then add both
bindmy and bindy become hard to do and so maintain
There was a problem hiding this comment.
I'm definitely happy for someone to take the idea and implement it much cleaner. I just wanted to see if it could work and hopefully get implemented in some way.
|
While i agree with the usecase, i don't think this is the best way to approach this as it only really solves one specific issue while implementing a whole other flag. I think a better approach would be a more generic "e" flag (exclusive), which only triggers if the bind is the only one fired while the modifier has been held down. Due to the nature of this, it would always imply Just a thought for now, i might take a look and try providing some code later. |
|
bind=none,Super_L,spawn,rofi -show drun i think already support now. |
That seems to have the "double-spawn" problem I'm trying to fix though? Does it not behave like that for you? |
More than happy for someone to allow the same "feature" with a cleaner implementation. I assume mine is super naive but just wanted to at least get the idea working. |
|
can confirm #918 works for me. I assume their method is cleaner so I can close this one. |
Added a
bindmconfig option. This is a modifier-only bind that fires on release but only if no other bind or mousebind used the modifier during that press.This makes it possible to use a modifier key by itself for things like
Superas a launcher trigger but without it firing after other combos:*note: I've only been able to test this in a nested environment at the moment, so whilst I did check the
bindmlline fires, I didn't check it with a real lock screen. Since it reuses the normal lock-screen logic I assume it should be okay.Implementation: a
mod_used_for_bindflag is set whenever a regular bind or mousebind fires while modifiers are held, and cleared on each modifier key press.bindmbinds only fire on modifier release if the flag is unset.