Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modifier-only keybinds exist #605

Open
miku4k opened this issue Aug 17, 2024 · 8 comments
Open

Modifier-only keybinds exist #605

miku4k opened this issue Aug 17, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@miku4k
Copy link

miku4k commented Aug 17, 2024

You can set a modifier-only shortcut by using the xkb name for the modifier as the second key (e.g. Super+Super_L). Hitting just the modifier, or any keybind that includes the modifier, triggers the mod-only bind.
I've only tested with Super+Super_L and the spawn action, but I believe other combinations behave similarly if not the same.

Checking that the non-mod key of a keybind isnt secretly a mod should be enough to fix this.

System Information

  • niri version: niri 0.1.7 (unknown commit)
    (most recent version currently available in NixOS unstable)
  • Distro: NixOS (unstable)
  • GPU: AMD integrated
  • CPU: AMD Ryzen 5 5500u
@miku4k miku4k added the bug Something isn't working label Aug 17, 2024
@YaLTeR
Copy link
Owner

YaLTeR commented Aug 17, 2024

Hm, I guess until we have release binds, this is more or less the best we can do. Though, maybe someone does use it, by carefully avoiding binds using that modifier...

@dev-nicolaos
Copy link

Is there an existing issue for release binds? I searched but couldn't find one. It would be nice to be able to bind an action to just Super without breaking all the other binds that use it as a modifier.

@YaLTeR
Copy link
Owner

YaLTeR commented Aug 17, 2024

I'm not sure there's an issue, but implementing release binds would involve some non trivial logic I imagine.

@jakesarjeant
Copy link

Is allowing mod-only binds necessarily a bug? I can think of at least a few use cases for it, but I'm not clear on what problem it causes... Anyone who doesn't want mod-only binds can just not make any, but it doesn't seem like there's any reason to disallow them for people who want them (of course, release binds are kind of necessary for them to be useful). I'm also bouncing around the idea of showing a workspace overview (see #624) while the mod key is held instead of putting it in my bar, so it seems useful to bind opening the view to Super+Super_L with a timer to close it after a few seconds.

@miku4k
Copy link
Author

miku4k commented Aug 24, 2024

they can lead to unexpected behavior if they arent accounted for, which they arent
especially the fact that they get executed

the disallowing them was more a temporary suggestion since i too think release binds would be complex to implement

and yes mod-only keybinds definitively have their uses (super opens some kind of menu on almost all desktops)

@jakesarjeant
Copy link

jakesarjeant commented Aug 24, 2024

Maybe a better solution would be to introduce an allow-mod-only; option in the binds section of the config and disallow them otherwise?

Should be fairly straightforward to implement

@dev-nicolaos
Copy link

I'm having trouble imagining a mod only keybind being useful without also being a release bind. Wouldn't the bound action run on every invocation of every other shortcut that uses that mod key? If that's the case, I worry introducing an allow-mod-only option would just be a waste of time.

@miku4k
Copy link
Author

miku4k commented Aug 25, 2024

yes they run every time you use that key be it in another shortcut or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants